{"openapi":"3.0.3","info":{"title":"TalkIt Website session grants","version":"2.0.0","description":"Server-relay session grant contract for TalkIt Website integrations."},"servers":[{"url":"https://your-dedicated-domain.example"}],"paths":{"/website/v2/server/session-grants":{"post":{"operationId":"createWebsiteServerSessionGrant","summary":"Create a Website session grant","security":[{"basicAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebsiteServerSessionGrantInput"},"example":{"channel":"text","externalSubjectId":"customer:9e6f0f63","externalSessionId":"session:3c2f38bd","profileClaims":{"displayName":"Alex Morgan","email":"alex@example.com"}}}}},"responses":{"200":{"description":"Session grant created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope"},"example":{"success":true,"data":{"sessionToken":"short-lived-one-use-token","websocketUrl":"wss://your-dedicated-domain.example/website/v2/text/_ws","expiresAt":"2026-08-11T12:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/CapacityUnavailable"},"500":{"$ref":"#/components/responses/ServerError"}}}}},"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"}},"responses":{"BadRequest":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"},"example":{"status":400,"statusText":"Bad Request","message":"Invalid Website session-grant request."}}}},"Unauthorized":{"description":"Missing or invalid Website integration credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"},"example":{"status":401,"statusText":"Unauthorized","message":"Basic authorization credentials are required."}}}},"Forbidden":{"description":"Website channel unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"},"example":{"status":403,"statusText":"Forbidden","message":"Website text channel is disabled."}}}},"NotFound":{"description":"Website integration or linked resource not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"},"example":{"status":404,"statusText":"Not Found","message":"Website integration was not found."}}}},"CapacityUnavailable":{"description":"Session-grant capacity unavailable.","headers":{"Retry-After":{"schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"},"example":{"status":429,"statusText":"Website Capacity Unavailable","message":"Website session-grant capacity is temporarily unavailable."}}}},"ServerError":{"description":"Server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"},"example":{"status":500,"statusText":"Internal Server Error","message":"Unable to create a Website session grant."}}}}},"schemas":{"WebsiteServerSessionGrantInput":{"type":"object","additionalProperties":false,"required":["channel","externalSubjectId","externalSessionId"],"properties":{"channel":{"type":"string","enum":["text","voice"]},"externalSubjectId":{"type":"string","minLength":8,"maxLength":200},"externalSessionId":{"type":"string","minLength":8,"maxLength":200},"profileClaims":{"$ref":"#/components/schemas/WebsiteProfileClaims"}}},"WebsiteProfileClaims":{"type":"object","additionalProperties":false,"properties":{"displayName":{"type":"string","minLength":1,"maxLength":200},"phone":{"type":"string","minLength":1,"maxLength":80},"email":{"type":"string","format":"email","minLength":1,"maxLength":320}}},"WebsiteSessionGrant":{"type":"object","additionalProperties":false,"required":["sessionToken","websocketUrl","expiresAt"],"properties":{"sessionToken":{"type":"string","minLength":32,"maxLength":512},"websocketUrl":{"type":"string","format":"uri"},"expiresAt":{"type":"string","format":"date-time"}}},"SuccessEnvelope":{"type":"object","additionalProperties":false,"required":["success","data"],"properties":{"success":{"type":"boolean","enum":[true]},"data":{"$ref":"#/components/schemas/WebsiteSessionGrant"}}},"HttpError":{"type":"object","additionalProperties":false,"required":["status","statusText","message"],"properties":{"status":{"type":"integer","minimum":100,"maximum":599},"statusText":{"type":"string"},"message":{"type":"string"}}}}}}