Organizations

All available operations for manipulating organizations and their information


Check out our integration guide to understand how user syncing fits in your backend workflow

Create or update an organization

This endpoint creates or updates an organization:

  • if the organization does not exist in the Cord backend (based on its ID), it will be created; some fields are required.
  • if the organization exists, it will be updated: all fields are optional, only the fields provided will be updated; if the request is updating the members list, the list is treated as exhaustive: all member user IDs must be included, previous members who are not in the list will be removed.

HTTP Request

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

For more information about IDs, check out our Identifiers concept breakdown.

Request Body

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


name

required
string
Organization name

status

optional
string
enum: ( "active" | "deleted" )

members

optional
array
List of partner-specific IDs of the users who are members of this organization

Example Request

curl "https://api.cord.com/v1/organizations/456" \
-X PUT \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
  "name": "Planet Express",
  "members": ["4", "42"]
}'
Copy

If successful, the response will be:

{
"success": true
}
Copy

Update organization members

Use this endpoint to add and/or remove members from an organization.

Requests to add a user that is already a member of that organization, or remove a user that is not a member, will have no effect (but will not return an error).

Note: It is an error to add and remove the same user in a single request.

HTTP Request

POST https://api.cord.com/v1/organizations/<ID>/members
Copy

Request Body

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


add

array

remove

array

Example Request

curl "https://api.cord.com/v1/organizations/456/members" \
  -X POST \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "add": ["4"],
    "remove": ["42"]
  }'
Copy

If successful, the response will be:

[
  {
    "id": "3001",
    "name": "Philip J Fry",
    "email": "delivery@planetexpress.nny",
    "first_name": "Philip",
    "last_name": "Fry"
  },
  {
    "id": "123",
    "name": "Bender Bending Rodriguez",
    "email": "bending@planetexpress.nny"
  }
]
Copy

List organizations

Use this endpoint to list all organizations that you have created within your Cord application.

HTTP Request

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

Request Body

This endpoint does not require a request body.

Example Request

curl "https://api.cord.com/v1/organizations" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
Copy

If successful, the response will be:

[
  {
    "id": "10",
    "name": "Planet Express"
  }
]
Copy

Get organization details

HTTP Request

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

For more information about IDs, check out our Identifiers concept breakdown.

Request Body

This endpoint does not require a request body.

Example Request

curl "https://api.cord.com/v1/organizations" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
Copy

If the request is successful and the organization exists, the response payload will be of the form:

{
  "id": "10",
  "name": "Planet Express",
  "members": ["4", "42"]
}
Copy

Delete an organization

This endpoint will permanently delete an organization and associated data. This operation will delete all threads and message associated with the organization. Please only use this endpoint if you are okay with that. Users will not be deleted because users can be in multiple organizations. However, deleting the organization also removes all users from the organization.

HTTP Request

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

For more information about IDs, check out our Identifiers concept breakdown.

Request Body

This endpoint does not require a request body.

Example Request

curl -X DELETE "https://api.cord.com/v1/organizations/<id>" \
  -H "Authorization: Bearer <ACCESS_TOKEN>"
Copy

If the request is successful and the organization is now deleted, the response payload will be of the form:

{
  "success": true,
}
Copy