{
"repository": "polymorfa/polymorfa",
"commit": "eda77760b56095a771c55e5d2df18be23e985377",
"sourcePath": "apps/api/docs/openapi.json",
"sourceSha256": "5b51b9933e2f002e2f845ee184eb243d62093d8acb4c4101fb4996cc2df79d85",
"operations": {
"getTestingPhone": {
"method": "GET",
"path": "/messaging/{session}/phone",
"operation": {
"operationId": "getTestingPhone",
"tags": ["Testing"],
"security": [
{
"BearerAuth": []
}
],
"summary": "Get a Test number's phone",
"x-required-scope": "sandbox:read",
"parameters": [
{
"schema": {
"type": "string",
"minLength": 1,
"maxLength": 256,
"description": "The Test number's session ID."
},
"required": true,
"name": "session",
"in": "path"
}
],
"responses": {
"200": {
"description": "The simulated phone and its linked companions",
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/TestingPhoneState"
}
}
},
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
}
},
"403": {
"description": "Test numbers access required, or a client token was used",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "permission_error",
"code": "permission_denied",
"message": "The credential does not have access to this resource.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
}
}
},
"404": {
"description": "Resource not found",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "invalid_request_error",
"code": "resource_not_found",
"message": "The resource is unavailable to this caller.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
}
}
},
"502": {
"description": "The simulated phone could not be read. Retry later.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "upstream_error",
"code": "upstream_failure",
"message": "The messaging provider could not complete the request.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#upstream-failure"
}
}
}
}
},
"x-mint": {
"content": "Linked Device API sandbox:read"
},
"x-protocols": ["Linked Device API"],
"description": "**Protocols:** Linked Device API\n\n**Required scope:** `sandbox:read`"
}
},
"sendTestingPhoneMessage": {
"method": "POST",
"path": "/messaging/{session}/phone/messages",
"operation": {
"operationId": "sendTestingPhoneMessage",
"tags": ["Testing"],
"security": [
{
"BearerAuth": []
}
],
"summary": "Send a message from a Test number's phone",
"x-required-scope": "sandbox:write",
"parameters": [
{
"schema": {
"type": "string",
"minLength": 1,
"maxLength": 256,
"description": "The Test number's session ID."
},
"required": true,
"name": "session",
"in": "path"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/TestingPhoneMessageRequest"
}
}
}
},
"responses": {
"202": {
"description": "The phone sent the message",
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/TestingPhoneMessage"
}
}
},
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
}
},
"400": {
"description": "Invalid recipient, or the phone is offline",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "invalid_request_error",
"code": "invalid_parameter",
"message": "Correct the invalid request field.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
}
}
},
"403": {
"description": "Test numbers access required, or a client token was used",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "permission_error",
"code": "permission_denied",
"message": "The credential does not have access to this resource.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
}
}
},
"404": {
"description": "Resource not found",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "invalid_request_error",
"code": "resource_not_found",
"message": "The resource is unavailable to this caller.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
}
}
},
"429": {
"description": "Testing rate limit reached",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "The request limit was reached. Follow Retry-After when supplied.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#rate-limit-exceeded"
}
}
}
},
"502": {
"description": "The phone could not send the message. Retry later.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "upstream_error",
"code": "upstream_failure",
"message": "The messaging provider could not complete the request.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#upstream-failure"
}
}
}
}
},
"x-mint": {
"content": "Linked Device API sandbox:write"
},
"x-protocols": ["Linked Device API"],
"description": "**Protocols:** Linked Device API\n\n**Required scope:** `sandbox:write`"
}
},
"unlinkTestingPhoneDevice": {
"method": "POST",
"path": "/messaging/{session}/phone/devices/{deviceId}/unlink",
"operation": {
"operationId": "unlinkTestingPhoneDevice",
"tags": ["Testing"],
"security": [
{
"BearerAuth": []
}
],
"summary": "Unlink a companion from a Test number's phone",
"x-required-scope": "sandbox:write",
"parameters": [
{
"schema": {
"type": "string",
"minLength": 1,
"maxLength": 256,
"description": "The Test number's session ID."
},
"required": true,
"name": "session",
"in": "path"
},
{
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 99,
"description": "The companion's device ID, as listed by the phone."
},
"required": true,
"name": "deviceId",
"in": "path"
}
],
"responses": {
"200": {
"description": "The companion was unlinked and logged out",
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/TestingPhoneUnlink"
}
}
},
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
}
},
"400": {
"description": "The phone is offline",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "invalid_request_error",
"code": "invalid_parameter",
"message": "Correct the invalid request field.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
}
}
},
"403": {
"description": "Test numbers access required, or a client token was used",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "permission_error",
"code": "permission_denied",
"message": "The credential does not have access to this resource.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
}
}
},
"404": {
"description": "Project or companion not found",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "invalid_request_error",
"code": "resource_not_found",
"message": "The resource is unavailable to this caller.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
}
}
},
"502": {
"description": "The phone could not unlink the companion. Retry later.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "upstream_error",
"code": "upstream_failure",
"message": "The messaging provider could not complete the request.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#upstream-failure"
}
}
}
}
},
"x-mint": {
"content": "Linked Device API sandbox:write"
},
"x-protocols": ["Linked Device API"],
"description": "**Protocols:** Linked Device API\n\n**Required scope:** `sandbox:write`"
}
},
"triggerTestEvent": {
"method": "POST",
"path": "/messaging/{session}/test-events",
"operation": {
"operationId": "triggerTestEvent",
"tags": ["Testing"],
"security": [
{
"BearerAuth": []
}
],
"summary": "Trigger a test event for a Test number",
"x-required-scope": "sandbox:write",
"parameters": [
{
"schema": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "Test Number ID."
},
"required": true,
"name": "session",
"in": "path"
},
{
"schema": {
"type": "string",
"pattern": "^[\\x21-\\x7e]{1,255}$",
"description": "Optional. Repeating a request with the same key and body reuses the same event ID, so a retry after a failed or uncertain response never creates a second event or duplicate webhook deliveries."
},
"required": false,
"name": "idempotency-key",
"in": "header"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/TriggerTestEventRequest"
}
}
}
},
"responses": {
"202": {
"description": "Test event accepted for delivery",
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/TriggerTestEventResponse"
}
}
},
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
}
},
"400": {
"description": "Invalid fixture or override",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "invalid_request_error",
"code": "invalid_parameter",
"message": "Correct the invalid request field.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
}
}
},
"403": {
"description": "Test numbers access required, or a client token was used",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "permission_error",
"code": "permission_denied",
"message": "The credential does not have access to this resource.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
}
}
},
"404": {
"description": "Resource not found",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "invalid_request_error",
"code": "resource_not_found",
"message": "The resource is unavailable to this caller.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
}
}
},
"429": {
"description": "Test event rate limit reached",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "The request limit was reached. Follow Retry-After when supplied.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#rate-limit-exceeded"
}
}
}
},
"502": {
"description": "Test event delivery unavailable. Retry with the same Idempotency-Key to avoid a second event.",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "upstream_error",
"code": "upstream_failure",
"message": "The messaging provider could not complete the request.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#upstream-failure"
}
}
}
}
},
"x-mint": {
"content": "Linked Device API sandbox:write"
},
"x-protocols": ["Linked Device API"],
"description": "**Protocols:** Linked Device API\n\n**Required scope:** `sandbox:write`"
}
},
"listTestEventFixtures": {
"method": "GET",
"path": "/messaging/test-events/fixtures",
"operation": {
"operationId": "listTestEventFixtures",
"tags": ["Testing"],
"security": [
{
"BearerAuth": []
}
],
"summary": "List test event fixtures",
"x-required-scope": "sandbox:read",
"responses": {
"200": {
"description": "Available fixtures and the overrides each accepts",
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/TestEventFixtureList"
}
}
},
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
}
},
"403": {
"description": "Read scope required; client tokens are not permitted",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "permission_error",
"code": "permission_denied",
"message": "The credential does not have access to this resource.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
}
}
}
},
"x-mint": {
"content": "sandbox:read"
},
"description": "**Required scope:** `sandbox:read`"
}
},
"createTestingHistoryFixture": {
"method": "POST",
"path": "/messaging/projects/{projectId}/test-history-fixtures",
"operation": {
"operationId": "createTestingHistoryFixture",
"tags": ["Testing"],
"security": [
{
"BearerAuth": []
}
],
"x-required-scope": "sandbox:write",
"parameters": [
{
"schema": {
"type": "string",
"format": "uuid"
},
"required": true,
"name": "projectId",
"in": "path"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"messages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 128
},
"senderPhone": {
"type": "string",
"pattern": "^\\+[1-9][0-9]{1,14}$"
},
"text": {
"type": "string",
"maxLength": 4096
},
"timestamp": {
"type": "integer",
"minimum": 0,
"exclusiveMinimum": true
},
"fromMe": {
"type": "boolean"
}
},
"required": [
"id",
"senderPhone",
"text",
"timestamp",
"fromMe"
],
"additionalProperties": false
},
"maxItems": 100
}
},
"required": ["messages"],
"additionalProperties": false
}
}
}
},
"responses": {
"201": {
"description": "Project-scoped history fixture",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"fixtureId": {
"type": "string",
"format": "uuid"
}
},
"required": ["fixtureId"]
}
}
},
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
}
},
"400": {
"description": "Invalid fixture",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "invalid_request_error",
"code": "invalid_parameter",
"message": "Correct the invalid request field.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#invalid-parameter"
}
}
}
},
"403": {
"description": "Test access required",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "permission_error",
"code": "permission_denied",
"message": "The credential does not have access to this resource.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#permission-denied"
}
}
}
},
"404": {
"description": "Project not found",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "invalid_request_error",
"code": "resource_not_found",
"message": "The resource is unavailable to this caller.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#resource-not-found"
}
}
}
},
"502": {
"description": "Test runtime unavailable",
"headers": {
"X-RateLimit-Limit": {
"$ref": "#/components/headers/X-RateLimit-Limit"
},
"X-RateLimit-Remaining": {
"$ref": "#/components/headers/X-RateLimit-Remaining"
},
"X-RateLimit-Reset": {
"$ref": "#/components/headers/X-RateLimit-Reset"
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/schemas/PublicError"
},
"example": {
"error": {
"type": "upstream_error",
"code": "upstream_failure",
"message": "The messaging provider could not complete the request.",
"param": null,
"request_id": "5f0c2a8e-3b1d-4c6f-9e2a-7d4b1c8f6a30"
},
"data": null,
"docs": "https://docs.polymorfa.com/api/errors#upstream-failure"
}
}
}
}
},
"x-mint": {
"content": "sandbox:write"
},
"description": "**Required scope:** `sandbox:write`"
}
}
},
"schemas": {
"TestingPhoneState": {
"type": "object",
"properties": {
"session": {
"type": "string"
},
"phone": {
"type": "string",
"description": "The Test number, in E.164 format."
},
"online": {
"type": "boolean",
"description": "True while the simulated phone is running."
},
"devices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"deviceId": {
"type": "integer"
}
},
"required": ["deviceId"]
},
"description": "Companions linked to the phone, such as Polymorfa's own session and Inspector."
}
},
"required": ["session", "phone", "online", "devices"]
},
"PublicError": {
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"invalid_request_error",
"authentication_error",
"permission_error",
"billing_error",
"conflict_error",
"rate_limit_error",
"api_error",
"upstream_error"
]
},
"code": {
"type": "string",
"enum": [
"zero_knowledge_session",
"invalid_parameter",
"invalid_credential",
"entitlement_required",
"cloud_template_authority_restricted",
"gate_limit_reached",
"billing_credit_required",
"addon_required",
"safe_mode_not_entitled",
"warmup_plan_not_entitled",
"method_not_allowed",
"permission_denied",
"missing_scope",
"resource_not_found",
"hms_not_enabled",
"media_fetch_failed",
"resource_gone",
"feature_unavailable",
"stream_cursor_invalid",
"stream_cursor_expired",
"stream_connection_limit_reached",
"state_conflict",
"team_deletion_scheduled",
"hybrid_routing_paused",
"hybrid_choice_required",
"hybrid_transition_ineligible",
"hybrid_automation_unavailable",
"hybrid_group_linked_devices_unavailable",
"hybrid_transport_unavailable",
"hybrid_target_reference_unavailable",
"send_outcome_unknown",
"idempotency_conflict",
"idempotency_in_progress",
"idempotency_completed",
"idempotency_outcome_unknown",
"call_claimed",
"call_not_ringing",
"connection_limit",
"unsupported_for_connection",
"call_permission_required",
"invalid_sip_trunk",
"calls_disabled",
"call_recipient_opted_out",
"call_destination_blocked",
"call_permission_request_limited",
"call_permission_granted",
"order_status_transition_invalid",
"order_cancellation_failed",
"call_opt_out_limit",
"number_restricted",
"sip_trunk_in_use",
"sip_trunk_revision_conflict",
"sip_trunk_limit",
"sip_unavailable",
"voice_not_enabled",
"provider_credential_invalid",
"provider_unavailable",
"asset_not_ready",
"voice_asset_in_use",
"voice_asset_revision_conflict",
"voice_unavailable",
"rate_limit_exceeded",
"internal_error",
"operation_not_supported",
"upstream_failure",
"service_unavailable",
"credential_verification_unavailable",
"session_not_ready",
"command_dispatch_failed",
"result_unknown",
"parent_bsuid_not_supported",
"recipient_not_on_whatsapp",
"conversation_window_closed",
"template_not_approved",
"media_too_large",
"whatsapp_rate_limited",
"new_chat_limit_reached",
"marketing_disabled_on_cloud_api",
"whatsapp_account_restricted",
"whatsapp_authorization_required",
"whatsapp_payment_method_required",
"whatsapp_number_not_registered",
"whatsapp_groups_ineligible",
"whatsapp_group_creation_paused",
"whatsapp_group_limit_reached",
"whatsapp_group_full",
"whatsapp_group_suspended",
"whatsapp_group_has_no_participants",
"bansafe_suspended",
"bansafe_org_suspended",
"bansafe_cold_blocked",
"bansafe_cold_held",
"bansafe_throttled",
"bansafe_daily_allowance_reached",
"bansafe_accounting_unavailable",
"bansafe_send_outcome_unknown",
"campaigns_not_entitled",
"campaign_throughput_capped",
"campaign_approval_required",
"campaign_approval_stale",
"campaign_variables_missing"
]
},
"message": {
"type": "string"
},
"param": {
"type": "string",
"nullable": true
},
"request_id": {
"type": "string",
"description": "Matches the X-Request-Id response header. Include it when you contact support."
},
"request_log_url": {
"type": "string",
"format": "uri",
"description": "Console page that shows this request. Returned only to organization and project credentials whose request was logged."
}
},
"required": ["type", "code", "message", "param", "request_id"]
},
"data": {
"type": "string",
"nullable": true,
"enum": [null],
"description": "Always null for a failed request."
},
"docs": {
"type": "string",
"format": "uri"
}
},
"required": ["error", "data", "docs"]
},
"TestingPhoneMessageRequest": {
"type": "object",
"properties": {
"to": {
"type": "string",
"pattern": "^\\+[1-9]\\d{7,14}$",
"description": "Another Test number in the same project, in E.164 format."
},
"text": {
"type": "string",
"minLength": 1,
"maxLength": 4096
}
},
"required": ["to", "text"],
"additionalProperties": false
},
"TestingPhoneMessage": {
"type": "object",
"properties": {
"session": {
"type": "string"
},
"to": {
"type": "string"
},
"messageId": {
"type": "string",
"nullable": true
}
},
"required": ["session", "to", "messageId"]
},
"TestingPhoneUnlink": {
"type": "object",
"properties": {
"session": {
"type": "string"
},
"deviceId": {
"type": "integer"
},
"unlinked": {
"type": "boolean",
"enum": [true]
}
},
"required": ["session", "deviceId", "unlinked"]
},
"TriggerTestEventRequest": {
"type": "object",
"properties": {
"event": {
"type": "string",
"enum": [
"message.received",
"message.ack",
"message.failed",
"call.received",
"call.missed",
"call.ended",
"session.status",
"session.restriction_updated",
"template.status"
],
"description": "Fixture name. Each name is the event type it produces."
},
"overrides": {
"$ref": "#/schemas/TestEventOverrides"
},
"fromNumber": {
"type": "string",
"minLength": 1,
"maxLength": 128,
"description": "message.received only. Send a simulated text message from this other connected Test number in the same project instead of generating an event."
}
},
"required": ["event"],
"additionalProperties": false
},
"TestEventOverrides": {
"type": "object",
"properties": {
"text": {
"type": "string",
"minLength": 1,
"maxLength": 4096
},
"from": {
"type": "string",
"pattern": "^\\+[1-9]\\d{7,14}$"
},
"pushName": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"mediaType": {
"type": "string",
"enum": ["image", "video", "audio", "document", "sticker"]
},
"caption": {
"type": "string",
"minLength": 1,
"maxLength": 1024
},
"ackStatus": {
"type": "string",
"enum": ["delivered", "read", "played", "error"]
},
"messageId": {
"type": "string",
"pattern": "^[1-9][0-9]{0,18}$"
},
"failureReason": {
"type": "string",
"enum": [
"invalid_recipient",
"session_not_connected",
"ack_timeout",
"send_failed",
"blocked_by_safety"
]
},
"video": {
"type": "boolean"
},
"durationSeconds": {
"type": "integer",
"minimum": 0,
"maximum": 86400
},
"callEndReason": {
"type": "string",
"enum": [
"user_hangup",
"timeout",
"lost_connection",
"rejected",
"call_restricted"
]
},
"restrictionActive": {
"type": "boolean"
},
"status": {
"type": "string",
"enum": ["CONNECTING", "CONNECTED", "DISCONNECTED"]
},
"statusReason": {
"type": "string",
"enum": [
"SCAN_QR",
"AUTO_RECONNECT",
"FAILED",
"MANUAL_STOP",
"QR_TIMEOUT",
"LOGGED_OUT",
"TEMPORARY_BAN",
"STREAM_ERROR"
]
},
"templateName": {
"type": "string",
"pattern": "^[a-z0-9_]{1,512}$"
},
"templateStatus": {
"type": "string",
"enum": ["APPROVED", "REJECTED"]
},
"reason": {
"type": "string",
"minLength": 1,
"maxLength": 256
}
},
"additionalProperties": false
},
"TriggerTestEventResponse": {
"type": "object",
"properties": {
"event": {
"type": "string",
"enum": [
"message.received",
"message.ack",
"message.failed",
"call.received",
"call.missed",
"call.ended",
"session.status",
"session.restriction_updated",
"template.status"
]
},
"session": {
"type": "string"
},
"delivery": {
"type": "string",
"enum": ["generated", "simulated"]
},
"eventId": {
"type": "string",
"nullable": true,
"format": "uuid"
},
"source": {
"type": "string",
"enum": ["test", "runtime"]
}
},
"required": ["event", "session", "delivery", "eventId", "source"]
},
"TestEventFixtureList": {
"type": "object",
"properties": {
"fixtures": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"enum": [
"message.received",
"message.ack",
"message.failed",
"call.received",
"call.missed",
"call.ended",
"session.status",
"session.restriction_updated",
"template.status"
]
},
"description": {
"type": "string"
},
"overrides": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["name", "description", "overrides"]
}
}
},
"required": ["fixtures"]
}
},
"components": {
"headers": {
"X-RateLimit-Limit": {
"description": "Team request quota per rolling minute, when the per-team request limiter applies.",
"schema": {
"type": "integer",
"minimum": 1
}
},
"X-RateLimit-Remaining": {
"description": "Requests left in the per-team quota; zero when this limiter rejects the request.",
"schema": {
"type": "integer",
"minimum": 0
}
},
"X-RateLimit-Reset": {
"description": "Unix timestamp in seconds when the oldest counted request leaves the rolling window, when the per-team request limiter applies. Follow Retry-After on a rejected request.",
"schema": {
"type": "integer",
"minimum": 0
}
}
}
}
}