# Integrations API

Report lifecycle events for remote delegation sessions.

## Report a remote delegation lifecycle event

`POST /api/remote-delegations/events`

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`.

```bash
curl -X POST 'https://api.factory.ai/api/remote-delegations/events' \
  -H "Authorization: Bearer $FACTORY_BEARER_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{ ... }'
```

**Parameters**

- `X-Factory-Org-Id` (`string`) - Header parameter. 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)

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "surface": {
      "type": "string",
      "enum": [
        "app",
        "droid-api",
        "jira",
        "linear",
        "slack",
        "microsoft-teams",
        "google-chat"
      ]
    },
    "delegationId": {
      "type": "string",
      "minLength": 1
    },
    "sessionId": {
      "type": "string",
      "minLength": 1
    },
    "event": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "session-started"
              ]
            }
          },
          "required": [
            "kind"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "droid-message"
              ]
            },
            "message": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "createdAt": {
                  "type": "number",
                  "minimum": -1.7976931348623157e+308,
                  "maximum": 1.7976931348623157e+308,
                  "description": "Unix timestamp, in milliseconds, when the message was created, as a finite number."
                }
              },
              "required": [
                "id",
                "createdAt"
              ],
              "additionalProperties": true
            }
          },
          "required": [
            "kind",
            "message"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "droid-status"
              ]
            },
            "status": {
              "type": "string",
              "enum": [
                "idle",
                "pending",
                "running"
              ]
            }
          },
          "required": [
            "kind",
            "status"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "code-channel-diff"
              ]
            },
            "configurationId": {
              "type": "string",
              "format": "uuid"
            },
            "channelId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "repository": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "url": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048
                },
                "branch": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                }
              },
              "required": [
                "name"
              ],
              "additionalProperties": false
            },
            "snapshot": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ready"
                      ]
                    },
                    "content": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000000
                    },
                    "baseBranch": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "headBranch": {
                      "type": "string",
                      "maxLength": 255
                    }
                  },
                  "required": [
                    "status",
                    "content",
                    "baseBranch"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "empty",
                        "unavailable",
                        "incomplete",
                        "stale",
                        "blocked"
                      ]
                    }
                  },
                  "required": [
                    "status"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "required": [
            "kind",
            "configurationId",
            "channelId",
            "snapshot"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "turn-failed"
              ]
            },
            "reason": {
              "type": "string",
              "enum": [
                "completed",
                "cancelled",
                "permission_rejected",
                "error",
                "process_exit",
                "spec_handoff",
                "structured_output_missing",
                "structured_output_invalid",
                "structured_output_schema_invalid",
                "model_usage_exhausted",
                "model_authentication_failed",
                "model_request_rejected",
                "model_provider_unreachable",
                "model_provider_unavailable",
                "model_rate_limited",
                "prompt_rejected",
                "completion_persistence_failed",
                "no_approver_available",
                "host_resources_exhausted"
              ]
            },
            "userMessageSource": {
              "type": "string",
              "enum": [
                "web",
                "desktop",
                "cli_tui",
                "cli_exec",
                "cli_acp",
                "slack",
                "jira",
                "linear",
                "microsoft-teams",
                "google-chat",
                "sessions_api",
                "api",
                "sdk",
                "automation",
                "readiness-remediation",
                "readiness-evaluation",
                "wiki-generation",
                "wiki-ci-setup"
              ]
            }
          },
          "required": [
            "kind",
            "reason"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "pull-request-created"
              ]
            },
            "url": {
              "type": "string",
              "format": "uri",
              "maxLength": 2048
            }
          },
          "required": [
            "kind",
            "url"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "enum": [
                "user-message"
              ]
            },
            "messageId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            "text": {
              "type": "string",
              "maxLength": 40000
            },
            "author": {
              "type": "object",
              "properties": {
                "userId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "name": {
                  "type": "string",
                  "maxLength": 256
                }
              },
              "required": [
                "userId"
              ],
              "additionalProperties": false
            },
            "mentions": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "userId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  }
                },
                "required": [
                  "userId",
                  "name"
                ],
                "additionalProperties": false
              },
              "maxItems": 20
            },
            "attachments": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "image",
                      "file"
                    ]
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 512
                  },
                  "mediaType": {
                    "type": "string",
                    "maxLength": 255
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              },
              "maxItems": 50
            }
          },
          "required": [
            "kind",
            "messageId",
            "text"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "required": [
    "surface",
    "delegationId",
    "sessionId",
    "event"
  ],
  "additionalProperties": false
}
```

**Response:** `200` - Response for status 200

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "enum": [
        true
      ]
    },
    "diffDelivery": {
      "type": "object",
      "properties": {
        "delivered": {
          "type": "boolean"
        },
        "retryAfterMs": {
          "type": "number",
          "description": "Milliseconds to wait before sending the next diff."
        }
      },
      "required": [
        "delivered"
      ],
      "description": "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."
    },
    "surfaceSyncOn": {
      "type": "boolean",
      "description": "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."
    }
  },
  "required": [
    "success"
  ]
}
```

**Response:** `400` - Response for status 400

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    },
    "requestId": {
      "type": "string",
      "description": "Request identifier to include when contacting support"
    },
    "code": {
      "type": "string",
      "description": "Stable machine-readable error code, when one applies"
    },
    "displayToUser": {
      "type": "boolean",
      "description": "True when detail is curated copy that is safe to show users"
    },
    "error": {
      "type": "object",
      "properties": {
        "detail": {
          "type": "string",
          "description": "Human-readable error message"
        },
        "status": {
          "type": "number",
          "description": "HTTP status code"
        },
        "title": {
          "type": "string",
          "description": "HTTP status title"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {},
          "description": "Additional error metadata"
        },
        "requestId": {
          "type": "string",
          "description": "Request identifier to include when contacting support"
        },
        "code": {
          "type": "string",
          "description": "Stable machine-readable error code, when one applies"
        },
        "displayToUser": {
          "type": "boolean",
          "description": "True when detail is curated copy that is safe to show users"
        }
      },
      "required": [
        "detail",
        "status",
        "title"
      ],
      "description": "The same error fields, for clients that only read body.error"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": true
}
```

**Response:** `401` - Response for status 401

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    },
    "requestId": {
      "type": "string",
      "description": "Request identifier to include when contacting support"
    },
    "code": {
      "type": "string",
      "description": "Stable machine-readable error code, when one applies"
    },
    "displayToUser": {
      "type": "boolean",
      "description": "True when detail is curated copy that is safe to show users"
    },
    "error": {
      "type": "object",
      "properties": {
        "detail": {
          "type": "string",
          "description": "Human-readable error message"
        },
        "status": {
          "type": "number",
          "description": "HTTP status code"
        },
        "title": {
          "type": "string",
          "description": "HTTP status title"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {},
          "description": "Additional error metadata"
        },
        "requestId": {
          "type": "string",
          "description": "Request identifier to include when contacting support"
        },
        "code": {
          "type": "string",
          "description": "Stable machine-readable error code, when one applies"
        },
        "displayToUser": {
          "type": "boolean",
          "description": "True when detail is curated copy that is safe to show users"
        }
      },
      "required": [
        "detail",
        "status",
        "title"
      ],
      "description": "The same error fields, for clients that only read body.error"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": true
}
```

**Response:** `402` - Response for status 402

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    },
    "requestId": {
      "type": "string",
      "description": "Request identifier to include when contacting support"
    },
    "code": {
      "type": "string",
      "description": "Stable machine-readable error code, when one applies"
    },
    "displayToUser": {
      "type": "boolean",
      "description": "True when detail is curated copy that is safe to show users"
    },
    "error": {
      "type": "object",
      "properties": {
        "detail": {
          "type": "string",
          "description": "Human-readable error message"
        },
        "status": {
          "type": "number",
          "description": "HTTP status code"
        },
        "title": {
          "type": "string",
          "description": "HTTP status title"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {},
          "description": "Additional error metadata"
        },
        "requestId": {
          "type": "string",
          "description": "Request identifier to include when contacting support"
        },
        "code": {
          "type": "string",
          "description": "Stable machine-readable error code, when one applies"
        },
        "displayToUser": {
          "type": "boolean",
          "description": "True when detail is curated copy that is safe to show users"
        }
      },
      "required": [
        "detail",
        "status",
        "title"
      ],
      "description": "The same error fields, for clients that only read body.error"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": true
}
```

**Response:** `403` - Response for status 403

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    },
    "requestId": {
      "type": "string",
      "description": "Request identifier to include when contacting support"
    },
    "code": {
      "type": "string",
      "description": "Stable machine-readable error code, when one applies"
    },
    "displayToUser": {
      "type": "boolean",
      "description": "True when detail is curated copy that is safe to show users"
    },
    "error": {
      "type": "object",
      "properties": {
        "detail": {
          "type": "string",
          "description": "Human-readable error message"
        },
        "status": {
          "type": "number",
          "description": "HTTP status code"
        },
        "title": {
          "type": "string",
          "description": "HTTP status title"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {},
          "description": "Additional error metadata"
        },
        "requestId": {
          "type": "string",
          "description": "Request identifier to include when contacting support"
        },
        "code": {
          "type": "string",
          "description": "Stable machine-readable error code, when one applies"
        },
        "displayToUser": {
          "type": "boolean",
          "description": "True when detail is curated copy that is safe to show users"
        }
      },
      "required": [
        "detail",
        "status",
        "title"
      ],
      "description": "The same error fields, for clients that only read body.error"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": true
}
```

**Response:** `404` - Response for status 404

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    },
    "requestId": {
      "type": "string",
      "description": "Request identifier to include when contacting support"
    },
    "code": {
      "type": "string",
      "description": "Stable machine-readable error code, when one applies"
    },
    "displayToUser": {
      "type": "boolean",
      "description": "True when detail is curated copy that is safe to show users"
    },
    "error": {
      "type": "object",
      "properties": {
        "detail": {
          "type": "string",
          "description": "Human-readable error message"
        },
        "status": {
          "type": "number",
          "description": "HTTP status code"
        },
        "title": {
          "type": "string",
          "description": "HTTP status title"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {},
          "description": "Additional error metadata"
        },
        "requestId": {
          "type": "string",
          "description": "Request identifier to include when contacting support"
        },
        "code": {
          "type": "string",
          "description": "Stable machine-readable error code, when one applies"
        },
        "displayToUser": {
          "type": "boolean",
          "description": "True when detail is curated copy that is safe to show users"
        }
      },
      "required": [
        "detail",
        "status",
        "title"
      ],
      "description": "The same error fields, for clients that only read body.error"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": true
}
```

**Response:** `409` - Response for status 409

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    },
    "requestId": {
      "type": "string",
      "description": "Request identifier to include when contacting support"
    },
    "code": {
      "type": "string",
      "description": "Stable machine-readable error code, when one applies"
    },
    "displayToUser": {
      "type": "boolean",
      "description": "True when detail is curated copy that is safe to show users"
    },
    "error": {
      "type": "object",
      "properties": {
        "detail": {
          "type": "string",
          "description": "Human-readable error message"
        },
        "status": {
          "type": "number",
          "description": "HTTP status code"
        },
        "title": {
          "type": "string",
          "description": "HTTP status title"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {},
          "description": "Additional error metadata"
        },
        "requestId": {
          "type": "string",
          "description": "Request identifier to include when contacting support"
        },
        "code": {
          "type": "string",
          "description": "Stable machine-readable error code, when one applies"
        },
        "displayToUser": {
          "type": "boolean",
          "description": "True when detail is curated copy that is safe to show users"
        }
      },
      "required": [
        "detail",
        "status",
        "title"
      ],
      "description": "The same error fields, for clients that only read body.error"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": true
}
```

**Response:** `413` - 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`.

Content type: `text/plain`

```json
{
  "type": "string",
  "description": "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`."
}
```

Content type: `application/json`

```json
{
  "type": "object",
  "description": "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\"}}`.",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    }
  },
  "not": {
    "required": [
      "detail"
    ]
  }
}
```

**Response:** `451` - Response for status 451

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    },
    "requestId": {
      "type": "string",
      "description": "Request identifier to include when contacting support"
    },
    "code": {
      "type": "string",
      "description": "Stable machine-readable error code, when one applies"
    },
    "displayToUser": {
      "type": "boolean",
      "description": "True when detail is curated copy that is safe to show users"
    },
    "error": {
      "type": "object",
      "properties": {
        "detail": {
          "type": "string",
          "description": "Human-readable error message"
        },
        "status": {
          "type": "number",
          "description": "HTTP status code"
        },
        "title": {
          "type": "string",
          "description": "HTTP status title"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {},
          "description": "Additional error metadata"
        },
        "requestId": {
          "type": "string",
          "description": "Request identifier to include when contacting support"
        },
        "code": {
          "type": "string",
          "description": "Stable machine-readable error code, when one applies"
        },
        "displayToUser": {
          "type": "boolean",
          "description": "True when detail is curated copy that is safe to show users"
        }
      },
      "required": [
        "detail",
        "status",
        "title"
      ],
      "description": "The same error fields, for clients that only read body.error"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": true
}
```

**Response:** `500` - Response for status 500

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    },
    "requestId": {
      "type": "string",
      "description": "Request identifier to include when contacting support"
    },
    "code": {
      "type": "string",
      "description": "Stable machine-readable error code, when one applies"
    },
    "displayToUser": {
      "type": "boolean",
      "description": "True when detail is curated copy that is safe to show users"
    },
    "error": {
      "type": "object",
      "properties": {
        "detail": {
          "type": "string",
          "description": "Human-readable error message"
        },
        "status": {
          "type": "number",
          "description": "HTTP status code"
        },
        "title": {
          "type": "string",
          "description": "HTTP status title"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {},
          "description": "Additional error metadata"
        },
        "requestId": {
          "type": "string",
          "description": "Request identifier to include when contacting support"
        },
        "code": {
          "type": "string",
          "description": "Stable machine-readable error code, when one applies"
        },
        "displayToUser": {
          "type": "boolean",
          "description": "True when detail is curated copy that is safe to show users"
        }
      },
      "required": [
        "detail",
        "status",
        "title"
      ],
      "description": "The same error fields, for clients that only read body.error"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": true
}
```

**Response:** `503` - Response for status 503

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "detail": {
      "type": "string",
      "description": "Human-readable error message"
    },
    "status": {
      "type": "number",
      "description": "HTTP status code"
    },
    "title": {
      "type": "string",
      "description": "HTTP status title"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Additional error metadata"
    },
    "requestId": {
      "type": "string",
      "description": "Request identifier to include when contacting support"
    },
    "code": {
      "type": "string",
      "description": "Stable machine-readable error code, when one applies"
    },
    "displayToUser": {
      "type": "boolean",
      "description": "True when detail is curated copy that is safe to show users"
    },
    "error": {
      "type": "object",
      "properties": {
        "detail": {
          "type": "string",
          "description": "Human-readable error message"
        },
        "status": {
          "type": "number",
          "description": "HTTP status code"
        },
        "title": {
          "type": "string",
          "description": "HTTP status title"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {},
          "description": "Additional error metadata"
        },
        "requestId": {
          "type": "string",
          "description": "Request identifier to include when contacting support"
        },
        "code": {
          "type": "string",
          "description": "Stable machine-readable error code, when one applies"
        },
        "displayToUser": {
          "type": "boolean",
          "description": "True when detail is curated copy that is safe to show users"
        }
      },
      "required": [
        "detail",
        "status",
        "title"
      ],
      "description": "The same error fields, for clients that only read body.error"
    }
  },
  "required": [
    "detail",
    "status",
    "title"
  ],
  "additionalProperties": true
}
```
