Skip to content

API Reference

The Cohera API provides programmatic access to all platform features. This reference documents every endpoint, request parameter, and response format.

EnvironmentBase URL
Productionhttps://api.cohera.io/v1
Sandboxhttps://sandbox.api.cohera.io/v1

The API version is included in the URL path. The current version is v1.

When we make breaking changes, we’ll release a new version. Non-breaking changes (new fields, new endpoints) are added to the current version.

VersionStatusDeprecation Date
v1Current-

All API requests must include:

Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
{
"type": "supplier",
"name": "Acme Chemicals",
"attributes": {
"country": "DE",
"qualification_status": "qualified"
}
}

All responses follow a consistent structure:

{
"data": {
"id": "ent_abc123",
"type": "supplier",
"name": "Acme Chemicals",
"attributes": {...},
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}
{
"data": [
{"id": "ent_abc123", ...},
{"id": "ent_def456", ...}
],
"meta": {
"total": 100,
"page": 1,
"per_page": 25,
"total_pages": 4
},
"links": {
"self": "/v1/entities?page=1",
"next": "/v1/entities?page=2",
"last": "/v1/entities?page=4"
}
}

Errors return appropriate HTTP status codes with detailed error information.

{
"error": {
"code": "validation_error",
"message": "The request body contains invalid data",
"details": [
{
"field": "attributes.country",
"message": "Must be a valid ISO 3166-1 alpha-2 country code"
}
],
"request_id": "req_abc123def456"
}
}
CodeDescription
200Success
201Created
204No Content (successful deletion)
400Bad Request - Invalid input
401Unauthorized - Invalid or missing credentials
403Forbidden - Insufficient permissions
404Not Found - Resource doesn’t exist
409Conflict - Resource already exists or state conflict
422Unprocessable Entity - Validation failed
429Too Many Requests - Rate limit exceeded
500Internal Server Error
503Service Unavailable
CodeDescription
validation_errorRequest body validation failed
not_foundRequested resource not found
unauthorizedAuthentication failed
forbiddenInsufficient permissions
conflictResource state conflict
rate_limit_exceededToo many requests
internal_errorServer error

List endpoints support cursor-based pagination for reliable results:

ParameterTypeDefaultDescription
pageinteger1Page number
per_pageinteger25Items per page (max 100)
cursorstring-Cursor for cursor-based pagination
Terminal window
curl "https://api.cohera.io/v1/entities?page=2&per_page=50" \
-H "Authorization: Bearer YOUR_API_KEY"

Most list endpoints support filtering:

Terminal window
# Filter by type
curl "https://api.cohera.io/v1/entities?type=supplier" \
-H "Authorization: Bearer YOUR_API_KEY"
# Filter by date range
curl "https://api.cohera.io/v1/entities?created_after=2024-01-01&created_before=2024-02-01" \
-H "Authorization: Bearer YOUR_API_KEY"
# Multiple filters
curl "https://api.cohera.io/v1/entities?type=supplier&attributes.country=DE" \
-H "Authorization: Bearer YOUR_API_KEY"

Use the sort parameter to order results:

Terminal window
# Sort by created date descending
curl "https://api.cohera.io/v1/entities?sort=-created_at" \
-H "Authorization: Bearer YOUR_API_KEY"
# Sort by name ascending
curl "https://api.cohera.io/v1/entities?sort=name" \
-H "Authorization: Bearer YOUR_API_KEY"

Prefix with - for descending order.

Reduce response size by selecting specific fields:

Terminal window
curl "https://api.cohera.io/v1/entities?fields=id,name,type" \
-H "Authorization: Bearer YOUR_API_KEY"

For POST requests, include an Idempotency-Key header to ensure the request is processed only once:

Terminal window
curl -X POST "https://api.cohera.io/v1/entities" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: unique-request-id-123" \
-H "Content-Type: application/json" \
-d '{"type": "supplier", "name": "Acme"}'

The idempotency key is valid for 24 hours.

See the Authentication guide for rate limit details.

Official SDKs are available at cohera.dev:

  • Python: pip install cohera
  • TypeScript/JavaScript: npm install @cohera/sdk
  • Go: go get github.com/cohera-io/cohera-go