Meta API

What every Motor service shares. Each team has a stream of events: what happened in the team, in Motor and in the other services. Motor keeps 30 days of it.

Motor's events: motor.team.created, motor.team.updated, motor.team.deleted, motor.team.card_saved, motor.team.suspended, motor.team.unsuspended, motor.member.added, motor.member.updated, motor.member.removed, motor.invite.created, motor.invite.deleted, motor.agent.started, motor.agent.ended, motor.invoice.created, motor.invoice.paid, motor.invoice.payment_failed, and motor.spending.limit_reached.

Base URL https://new.motor.dev · version 2026-10-22 · OpenAPI 3.1 spec

Events

The stream of a team's events.

GET /api/meta/events

List events

Returns a team's events after the event after, oldest first, for up to 30 days back. Poll with next_cursor as after, or stream instead. Needs events:read for an agent.

ParameterTypeDescription
team_idin querystring

The team's ID. An agent token reads its own team's stream if you don't say.

afterin querystring

The ID of the last event that you have. The start of the stream if you don't say.

limitin queryinteger

The most items in the page, from 1 to 100. 50 if you don't say.

Responses

200A page of events.

FieldTypeDescription
dataarray of object
has_moreboolean

Whether more events follow now.

next_cursorstring or null

The ID of the last event of the page, for after; the given after when the page is empty; null when the stream is empty.

{
  "data": [
    {
      "created_at": "2026-10-22T09:00:00.000Z",
      "data": {
        "agent_id": "agent_1BbA6sXxyUWHYvKqN5T3dM",
        "expires_at": "2026-10-23T09:00:00Z",
        "name": "reviewer",
        "scopes": [
          "current:*"
        ],
        "user_id": "user_1BbA6sXxyUWHYvKqN5T3dM"
      },
      "id": "evt_1BbA6sXxyUWHYvKqN5T3dM",
      "team_id": "team_1BbA6sXxyUWHYvKqN5T3dM",
      "type": "motor.agent.started"
    }
  ],
  "has_more": false,
  "next_cursor": "evt_1BbA6sXxyUWHYvKqN5T3dM"
}

401The credential is missing, unknown, revoked, or expired, or a bound session key has no valid DPoP proof.

{
  "error": {
    "code": "unauthorized",
    "message": "The credential is unknown, revoked, or expired.",
    "retryable": false
  }
}

403The credential can't do this.

{
  "error": {
    "code": "forbidden",
    "message": "Your credential can't do this.",
    "retryable": false
  }
}

404There is no such resource, or the credential can't see it.

{
  "error": {
    "code": "not_found",
    "message": "There is no such resource, or you can't see it.",
    "retryable": false
  }
}

422A field or a parameter has a value that Motor can't accept.

{
  "error": {
    "code": "invalid_field",
    "message": "`name` is required.",
    "retryable": false
  }
}

GET /api/meta/events/stream

Stream events

Streams a team's events as server-sent events, from after the event in Last-Event-ID or after, or from now. Each event is id: <event ID>, event: <type>, and data: <the event as JSON>. A comment comes every 25 seconds. A stream ends after an hour; connect again with the ID of the last event that you got. Needs events:read for an agent.

ParameterTypeDescription
team_idin querystring

The team's ID. An agent token reads its own team's stream if you don't say.

afterin querystring

The ID of the last event that you have.

Last-Event-IDin headerstring

The ID of the last event that you got; browsers send it when they connect again.

Responses

200The stream.

id: evt_1BbA6sXxyUWHYvKqN5T3dM
event: motor.agent.started
data: {"id":"evt_1BbA6sXxyUWHYvKqN5T3dM","type":"motor.agent.started","team_id":"team_1BbA6sXxyUWHYvKqN5T3dM","data":{"agent_id":"agent_1BbA6sXxyUWHYvKqN5T3dM"},"created_at":"2026-10-22T09:00:00.000Z"}

401The credential is missing, unknown, revoked, or expired, or a bound session key has no valid DPoP proof.

{
  "error": {
    "code": "unauthorized",
    "message": "The credential is unknown, revoked, or expired.",
    "retryable": false
  }
}

403The credential can't do this.

{
  "error": {
    "code": "forbidden",
    "message": "Your credential can't do this.",
    "retryable": false
  }
}

404There is no such resource, or the credential can't see it.

{
  "error": {
    "code": "not_found",
    "message": "There is no such resource, or you can't see it.",
    "retryable": false
  }
}

422A field or a parameter has a value that Motor can't accept.

{
  "error": {
    "code": "invalid_field",
    "message": "`name` is required.",
    "retryable": false
  }
}

GET /api/meta/events/{event_id}

Get an event

Returns one event of a team's stream.

ParameterTypeDescription
event_idrequired in pathstring

The event's ID.

team_idin querystring

The team's ID. An agent token reads its own team's stream if you don't say.

Responses

200The event.

FieldTypeDescription
created_atstring
dataobject

The event's fields, which depend on its type.

idstring

The event's ID, which is also its place in the stream.

team_idstring

The team's ID.

typestring

What happened, as <service>.<resource>.<verb>, such as motor.agent.started.

{
  "created_at": "2026-10-22T09:00:00.000Z",
  "data": {
    "agent_id": "agent_1BbA6sXxyUWHYvKqN5T3dM",
    "expires_at": "2026-10-23T09:00:00Z",
    "name": "reviewer",
    "scopes": [
      "current:*"
    ],
    "user_id": "user_1BbA6sXxyUWHYvKqN5T3dM"
  },
  "id": "evt_1BbA6sXxyUWHYvKqN5T3dM",
  "team_id": "team_1BbA6sXxyUWHYvKqN5T3dM",
  "type": "motor.agent.started"
}

401The credential is missing, unknown, revoked, or expired, or a bound session key has no valid DPoP proof.

{
  "error": {
    "code": "unauthorized",
    "message": "The credential is unknown, revoked, or expired.",
    "retryable": false
  }
}

403The credential can't do this.

{
  "error": {
    "code": "forbidden",
    "message": "Your credential can't do this.",
    "retryable": false
  }
}

404There is no such resource, or the credential can't see it.

{
  "error": {
    "code": "not_found",
    "message": "There is no such resource, or you can't see it.",
    "retryable": false
  }
}

422A field or a parameter has a value that Motor can't accept.

{
  "error": {
    "code": "invalid_field",
    "message": "`name` is required.",
    "retryable": false
  }
}