Skip to content
Esc
↑↓navigate↵open⌘Jpreview

Get history

Get change history for a company. Returns audit trail of modifications with user attribution.

GET/companies/{companyId}/history
Authorization
AuthorizationBearer token · headerrequired

Organization API key (modem_…).

Path parameters
companyIdstringrequired
matches ^\d+$
Query parameters
changedByFilterstring[]

Filter by actor type. Defaults to user and agent changes (excludes system).

limitinteger

Maximum number of history records to return (default 20, max 50).

max 50 · default: 20
Responses
200

OK

historyobject[]required
Show properties
Array of object
changedAtstring<date-time>
changedBystringrequired

Actor type that initiated the change: system (internal/cascading), agent (AI), or user (manual).

Allowed:agentsystemuser
changesobjectrequired
idstring<uuid>required
Show properties
Any of:
string<uuid>
string<uuid>
string<uuid>
string<uuid>
operationstringrequired

Type of database operation that triggered the history record.

Allowed:DELETEINSERTUPDATE
previousValuesobject | nullrequired
Show properties
Any of:
object
object
null
null
userobject | nullrequired
Show properties
Any of:
object
idstringrequired
Show properties
Any of:
string
string
string
string
imagestring | nullrequired

Optional URL to the user avatar image.

Show properties
Any of:
string
string
null
null
namestringrequired

Human-readable name of the user.

null
null
mergedIntoobject | nullrequired
Show properties
Any of:
object
idstringrequired
mergedAtstring<date-time>
targetCompanyobject | nullrequired
Show properties
Any of:
object
idstringrequired
namestringrequired
null
null
userobject | nullrequired
Show properties
Any of:
object
idstringrequired
Show properties
Any of:
string
string
string
string
imagestring | nullrequired

Optional URL to the user avatar image.

Show properties
Any of:
string
string
null
null
namestringrequired

Human-readable name of the user.

null
null
null
null
mergesobject[]required
Show properties
Array of object
idstringrequired
mergedAtstring<date-time>
sourceCompaniesobject[]required
Show properties
Array of object
idstringrequired
namestringrequired
userobject | nullrequired
Show properties
Any of:
object
idstringrequired
Show properties
Any of:
string
string
string
string
imagestring | nullrequired

Optional URL to the user avatar image.

Show properties
Any of:
string
string
null
null
namestringrequired

Human-readable name of the user.

null
null
totalCountnumberrequired
400

Invalid request (validation failed).

codestringrequired

Machine-readable error code, e.g. NOT_FOUND.

dataany

Optional structured error details.

definedbooleanrequired

True if the error was declared in the procedure contract.

messagestringrequired

Human-readable error message.

statusintegerrequired

HTTP status code.

401

Missing or invalid API key.

codestringrequired

Machine-readable error code, e.g. NOT_FOUND.

dataany

Optional structured error details.

definedbooleanrequired

True if the error was declared in the procedure contract.

messagestringrequired

Human-readable error message.

statusintegerrequired

HTTP status code.

403

The API key does not have access to this resource.

codestringrequired

Machine-readable error code, e.g. NOT_FOUND.

dataany

Optional structured error details.

definedbooleanrequired

True if the error was declared in the procedure contract.

messagestringrequired

Human-readable error message.

statusintegerrequired

HTTP status code.

404

The requested resource was not found.

codestringrequired

Machine-readable error code, e.g. NOT_FOUND.

dataany

Optional structured error details.

definedbooleanrequired

True if the error was declared in the procedure contract.

messagestringrequired

Human-readable error message.

statusintegerrequired

HTTP status code.

429

Rate limit exceeded.

codestringrequired

Machine-readable error code, e.g. NOT_FOUND.

dataany

Optional structured error details.

definedbooleanrequired

True if the error was declared in the procedure contract.

messagestringrequired

Human-readable error message.

statusintegerrequired

HTTP status code.

500

Internal server error.

codestringrequired

Machine-readable error code, e.g. NOT_FOUND.

dataany

Optional structured error details.

definedbooleanrequired

True if the error was declared in the procedure contract.

messagestringrequired

Human-readable error message.

statusintegerrequired

HTTP status code.

Try it
Server
Authorization
Parameters
Request
curl -X GET 'https://api.modem.dev/v1/companies/string/history' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "history": [
    {
      "changedAt": "2019-08-24T14:15:22Z",
      "changedBy": "agent",
      "changes": {
        "property1": null,
        "property2": null
      },
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "operation": "DELETE",
      "previousValues": {
        "property1": null,
        "property2": null
      },
      "user": {
        "id": "string",
        "image": "string",
        "name": "string"
      }
    }
  ],
  "mergedInto": {
    "id": "string",
    "mergedAt": "2019-08-24T14:15:22Z",
    "targetCompany": {
      "id": "string",
      "name": "string"
    },
    "user": {
      "id": "string",
      "image": "string",
      "name": "string"
    }
  },
  "merges": [
    {
      "id": "string",
      "mergedAt": "2019-08-24T14:15:22Z",
      "sourceCompanies": [
        {
          "id": "string",
          "name": "string"
        }
      ],
      "user": {
        "id": "string",
        "image": "string",
        "name": "string"
      }
    }
  ],
  "totalCount": 0
}

Was this page helpful?