Threads

All available operations for listing and editing threads


List all threads

This endpoint returns information about all threads in an application.

HTTP Request

GET https://api.cord.com/v1/threads/
Copy

Request Body

This REST endpoint has no request body.

Response

The response is a JSON Array with objects with the following fields:


id

string
The ID for this thread.

organizationID

string
The organization ID this thread is in.

total

number
The total number of messages in this thread.

resolved

boolean
Whether this thread is resolved. In a GET request, this is equivalent to !!resolvedTimestamp. In a PUT request, setting this to true is equivalent to setting resolvedTimestamp to the current time, and setting this to false is equivalent to setting resolvedTimestamp to null.

resolvedTimestamp

string
format: date-time
The timestamp when this thread was resolved. Set to null if this thread is not resolved.

participants

array
All of the users who are subscribed to this thread.

This is an array of objects, each of which has the following fields:


lastSeenTimestamp

string
format: date-time
The timestamp of the most recent message or reaction that this user has seen in this thread. Is null if this participant has never viewed this thread.

userID

string
The user ID of the participant. Can be null if the current viewer no longer shares an organization with this participant (and therefore can no longer access that participant's information).

name

string
The name of this thread.

location

object
The location of this thread.

metadata

object
FlatJsonObject is an object where all values are simple, scalar types (string, number or boolean).

Get a thread

This endpoint gets information about a specific thread.

HTTP Request

GET https://api.cord.com/v1/threads/<ID>
Copy

Request Body

This REST endpoint has no request body.

Response

The response is a JSON object with the following fields:


id

string
The ID for this thread.

organizationID

string
The organization ID this thread is in.

total

number
The total number of messages in this thread.

resolved

boolean
Whether this thread is resolved. In a GET request, this is equivalent to !!resolvedTimestamp. In a PUT request, setting this to true is equivalent to setting resolvedTimestamp to the current time, and setting this to false is equivalent to setting resolvedTimestamp to null.

resolvedTimestamp

string
format: date-time
The timestamp when this thread was resolved. Set to null if this thread is not resolved.

participants

array
All of the users who are subscribed to this thread.

This is an array of objects, each of which has the following fields:


lastSeenTimestamp

string
format: date-time
The timestamp of the most recent message or reaction that this user has seen in this thread. Is null if this participant has never viewed this thread.

userID

string
The user ID of the participant. Can be null if the current viewer no longer shares an organization with this participant (and therefore can no longer access that participant's information).

name

string
The name of this thread.

location

object
The location of this thread.

metadata

object
FlatJsonObject is an object where all values are simple, scalar types (string, number or boolean).

Update a thread

This endpoint updates an existing thread.

HTTP Request

PUT https://api.cord.com/v1/threads/<ID>
Copy

Request Body

Listed below are the fields of the request body to be added as part of the HTTP PUT request.


location

optional
object
The location of this thread.

id

optional
string
The ID for this thread.

name

optional
string
The name of this thread.

metadata

optional
object
FlatJsonObject is an object where all values are simple, scalar types (string, number or boolean).

resolvedTimestamp

optional
string
format: date-time
The timestamp when this thread was resolved. Set to null if this thread is not resolved.

organizationID

optional
string
The organization ID this thread is in.

resolved

optional
boolean
Whether this thread is resolved. In a GET request, this is equivalent to !!resolvedTimestamp. In a PUT request, setting this to true is equivalent to setting resolvedTimestamp to the current time, and setting this to false is equivalent to setting resolvedTimestamp to null.

userID

optional
string
Certain changes to the thread may post a message into the thread -- in particular, resolving or unresolving a thread posts a message into the thread saying "User un/resolved this thread". This paramter is the ID of the User who will be listed as the author of that message. It's optional -- if no user is specified, then those messasges won't get posted.

typing

optional
array
Triggers the typing indicator, or adds an additional user to the existing typing indicator in the thread and lasts for 3 seconds. Pass an empty array to clear all users typing. Automatically triggers when a user is writing something in a Cord component.

Response

If successful, the response will be:

{
  "success": true,
  "message": "✅ You successfully updated thread abc123"
}
Copy

Delete a thread

This endpoint deletes a thread.

HTTP Request

DELETE https://api.cord.com/v1/threads/<ID>
Copy

Request Body

This REST endpoint has no request body.

Response

If successful, the response will be:

{
  "success": true,
  "message": "💀 You successfully deleted thread abc123"
}
Copy