Integrations API
Report lifecycle events for remote delegation sessions.
Report a remote delegation lifecycle event
Reports one event of a remote delegation session, sent by the machine running the session with the `surface` and `delegationId` the delegation was started with. Only the principal that owns the delegation can report its events (403), a delegation that does not exist answers 404, and an event from a session a newer session has replaced answers 409. A droid message reaches a surface only when its `role` is `assistant` and its `visibility` is not `user_only`; any other accepted droid message answers 200 without reaching one. Code channel diff content is limited to 1,000,000 UTF-8 bytes, and a code channel diff whose request body is larger than 2,000,000 UTF-8 bytes answers 400. In an otherwise valid user message event, `text` of 20,001 characters outside the Basic Multilingual Plane, such as most emoji, is 40,002 UTF-16 code units and answers 400, though the request body's `maxLength` of 40,000 counts characters and admits it. In an otherwise valid pull request event, the `url` values `https://example.com/a b`, `https://例子.测试`, `https://example.com/é` and `https://example.com/` followed by U+0001 answer 200, though the request body's `format: uri` refuses them, and `https://` answers 400, though `format: uri` admits it: the handler checks `url` with the WHATWG URL parser. A code channel diff's `repository.url` is checked by the same parser. In an otherwise valid user message event, a `mentions` value with an entry whose `userId` is empty, with more than 20 entries, or that is not an array, each of which the request body refuses, answers 200, and the event is forwarded without `mentions`.
curl -X POST 'https://api.factory.ai/api/remote-delegations/events' \
-H "Authorization: Bearer $FACTORY_BEARER_TOKEN" \
-H 'Content-Type: application/json' \
-d '{ ... }'Parameters
Organization a JWT request acts in; required to act in a sub-organization. Without it, the request acts in the user's root organization, or is rejected with 403 when the user cannot access the root organization. API keys always act in their own organization and ignore this header.
Request body
Required
application/json
No additional properties
Allowed values
Minimum length: 1
Minimum length: 1
No additional properties
Allowed values
No additional properties
Allowed values
Unix timestamp, in milliseconds, when the message was created, as a finite number.
Minimum: -1.7976931348623157e+308
Maximum: 1.7976931348623157e+308
No additional properties
Allowed values
Allowed values
No additional properties
Allowed values
Minimum length: 1
Maximum length: 128
No additional properties
Minimum length: 1
Maximum length: 128
Maximum length: 2048
Minimum length: 1
Maximum length: 128
No additional properties
Allowed values
Minimum length: 1
Maximum length: 1000000
Maximum length: 255
Maximum length: 255
No additional properties
Allowed values
No additional properties
Allowed values
Allowed values
Allowed values
No additional properties
Allowed values
Maximum length: 2048
No additional properties
Allowed values
Minimum length: 1
Maximum length: 256
Maximum length: 40000
No additional properties
Minimum length: 1
Maximum length: 256
Maximum length: 256
Maximum items: 20
Array items
No additional properties
Minimum length: 1
Maximum length: 256
Minimum length: 1
Maximum length: 256
Maximum items: 50
Array items
No additional properties
Allowed values
Maximum length: 512
Maximum length: 255
Responses
application/json
Allowed values
Returned only for a code channel diff event. A diff that could not be delivered is reported here, inside the 200 response, rather than as an error.
Milliseconds to wait before sending the next diff.
Returned for a `running` droid status event when the delegation's surface mirrors prompts typed in the app: whether surface sync is on for the session. Absent when the backend cannot read the setting.
400Response for status 400
application/json
Human-readable error message
HTTP status code
HTTP status title
Additional error metadata
Values
objectRequest identifier to include when contacting support
Stable machine-readable error code, when one applies
True when detail is curated copy that is safe to show users
The same error fields, for clients that only read body.error
Human-readable error message
HTTP status code
HTTP status title
Additional error metadata
Values
objectRequest identifier to include when contacting support
Stable machine-readable error code, when one applies
True when detail is curated copy that is safe to show users
401Response for status 401
application/json
Human-readable error message
HTTP status code
HTTP status title
Additional error metadata
Values
objectRequest identifier to include when contacting support
Stable machine-readable error code, when one applies
True when detail is curated copy that is safe to show users
The same error fields, for clients that only read body.error
Human-readable error message
HTTP status code
HTTP status title
Additional error metadata
Values
objectRequest identifier to include when contacting support
Stable machine-readable error code, when one applies
True when detail is curated copy that is safe to show users
402Response for status 402
application/json
Human-readable error message
HTTP status code
HTTP status title
Additional error metadata
Values
objectRequest identifier to include when contacting support
Stable machine-readable error code, when one applies
True when detail is curated copy that is safe to show users
The same error fields, for clients that only read body.error
Human-readable error message
HTTP status code
HTTP status title
Additional error metadata
Values
objectRequest identifier to include when contacting support
Stable machine-readable error code, when one applies
True when detail is curated copy that is safe to show users
403Response for status 403
application/json
Human-readable error message
HTTP status code
HTTP status title
Additional error metadata
Values
objectRequest identifier to include when contacting support
Stable machine-readable error code, when one applies
True when detail is curated copy that is safe to show users
The same error fields, for clients that only read body.error
Human-readable error message
HTTP status code
HTTP status title
Additional error metadata
Values
objectRequest identifier to include when contacting support
Stable machine-readable error code, when one applies
True when detail is curated copy that is safe to show users
404Response for status 404
application/json
Human-readable error message
HTTP status code
HTTP status title
Additional error metadata
Values
objectRequest identifier to include when contacting support
Stable machine-readable error code, when one applies
True when detail is curated copy that is safe to show users
The same error fields, for clients that only read body.error
Human-readable error message
HTTP status code
HTTP status title
Additional error metadata
Values
objectRequest identifier to include when contacting support
Stable machine-readable error code, when one applies
True when detail is curated copy that is safe to show users
409Response for status 409
application/json
Human-readable error message
HTTP status code
HTTP status title
Additional error metadata
Values
objectRequest identifier to include when contacting support
Stable machine-readable error code, when one applies
True when detail is curated copy that is safe to show users
The same error fields, for clients that only read body.error
Human-readable error message
HTTP status code
HTTP status title
Additional error metadata
Values
objectRequest identifier to include when contacting support
Stable machine-readable error code, when one applies
True when detail is curated copy that is safe to show users
413The platform edge refused a body over its own size limit before the route ran, for example `Request Entity Too Large` followed by an error code such as `FUNCTION_PAYLOAD_TOO_LARGE`.
text/plain
The platform edge refused a body over its own size limit before the route ran, for example `Request Entity Too Large` followed by an error code such as `FUNCTION_PAYLOAD_TOO_LARGE`.
stringapplication/json
The platform edge refused a body over its own size limit before the route ran, and answered in JSON because the request accepts JSON, for example `{"error":{"code":"413","message":"Request Entity Too Large"}}`.
Must not include detail
451Response for status 451
application/json
Human-readable error message
HTTP status code
HTTP status title
Additional error metadata
Values
objectRequest identifier to include when contacting support
Stable machine-readable error code, when one applies
True when detail is curated copy that is safe to show users
The same error fields, for clients that only read body.error
Human-readable error message
HTTP status code
HTTP status title
Additional error metadata
Values
objectRequest identifier to include when contacting support
Stable machine-readable error code, when one applies
True when detail is curated copy that is safe to show users
500Response for status 500
application/json
Human-readable error message
HTTP status code
HTTP status title
Additional error metadata
Values
objectRequest identifier to include when contacting support
Stable machine-readable error code, when one applies
True when detail is curated copy that is safe to show users
The same error fields, for clients that only read body.error
Human-readable error message
HTTP status code
HTTP status title
Additional error metadata
Values
objectRequest identifier to include when contacting support
Stable machine-readable error code, when one applies
True when detail is curated copy that is safe to show users
503Response for status 503
application/json
Human-readable error message
HTTP status code
HTTP status title
Additional error metadata
Values
objectRequest identifier to include when contacting support
Stable machine-readable error code, when one applies
True when detail is curated copy that is safe to show users
The same error fields, for clients that only read body.error
Human-readable error message
HTTP status code
HTTP status title
Additional error metadata
Values
objectRequest identifier to include when contacting support
Stable machine-readable error code, when one applies
True when detail is curated copy that is safe to show users