{"openapi":"3.0.3","info":{"title":"Texttive API","version":"1.0.0","description":"Prepaid business SMS\/MMS. Authenticate with `Authorization: Bearer <api key>`. Responses are wrapped in `{data}`; errors in `{error:{code,message}}`."},"servers":[{"url":"https:\/\/app.texttive.com\/api\/v1"}],"security":[{"bearerAuth":[]}],"paths":{"\/me":{"get":{"summary":"Account, wallet and key info","responses":{"200":{"description":"OK"}}}},"\/messages":{"get":{"summary":"List messages","parameters":[{"name":"status","in":"query","schema":{"type":"string"}},{"name":"direction","in":"query","schema":{"type":"string","enum":["in","out"]}},{"name":"to","in":"query","schema":{"type":"string"}},{"name":"since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"client_ref","in":"query","schema":{"type":"string"}},{"name":"page","in":"query","schema":{"type":"integer"}},{"name":"per_page","in":"query","schema":{"type":"integer","maximum":100}}],"responses":{"200":{"description":"Paginated list"}}},"post":{"summary":"Send a message","parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/SendMessage"}}}},"responses":{"201":{"description":"Created (inspect `status`: queued, scheduled or blocked)","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/Message"}}}}}},"409":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}},"422":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/messages\/{id}":{"get":{"summary":"Get a message","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"OK","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/Message"}}}}}},"404":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/numbers":{"get":{"summary":"List your phone numbers","responses":{"200":{"description":"OK"}}}},"\/lookups":{"post":{"summary":"Carrier lookup","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["phone"],"properties":{"phone":{"type":"string"}}}}}},"responses":{"201":{"description":"Result","content":{"application\/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#\/components\/schemas\/Lookup"}}}}}},"402":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/opt-outs":{"get":{"summary":"List opted-out numbers","responses":{"200":{"description":"OK"}}},"post":{"summary":"Record an opt-out","requestBody":{"required":true,"content":{"application\/json":{"schema":{"type":"object","required":["phone"],"properties":{"phone":{"type":"string"}}}}}},"responses":{"201":{"description":"Created"}}}},"\/opt-outs\/{phone}":{"get":{"summary":"Check one number","parameters":[{"name":"phone","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}},"delete":{"summary":"Remove an opt-out (requires renewed consent)","parameters":[{"name":"phone","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Error","content":{"application\/json":{"schema":{"$ref":"#\/components\/schemas\/Error"}}}}}}},"\/contacts":{"get":{"summary":"List contacts","responses":{"200":{"description":"OK"}}},"post":{"summary":"Create or update a contact by phone","responses":{"201":{"description":"Created"},"200":{"description":"Updated"}}}},"\/contacts\/{id}":{"get":{"summary":"Get a contact","responses":{"200":{"description":"OK"}}},"patch":{"summary":"Update a contact","responses":{"200":{"description":"OK"}}},"delete":{"summary":"Delete a contact","responses":{"204":{"description":"Deleted"}}}},"\/webhooks":{"get":{"summary":"List webhook endpoints","responses":{"200":{"description":"OK"}}},"post":{"summary":"Create a webhook endpoint (secret returned once)","responses":{"201":{"description":"Created"}}}},"\/webhooks\/{id}":{"delete":{"summary":"Delete an endpoint","responses":{"204":{"description":"Deleted"}}}},"\/webhooks\/{id}\/test":{"post":{"summary":"Send a ping event","responses":{"202":{"description":"Queued"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object"}}}}},"SendMessage":{"type":"object","required":["from","to"],"properties":{"from":{"type":"string","description":"One of your numbers (E.164) or its id"},"to":{"type":"string","description":"Recipient (E.164 or US 10-digit)"},"body":{"type":"string","maxLength":1600},"media":{"type":"array","items":{"type":"string","format":"uri"}},"kind":{"type":"string","enum":["marketing","transactional"],"default":"marketing"},"scheduled_at":{"type":"string","format":"date-time"},"client_ref":{"type":"string"},"defer_quiet_hours":{"type":"boolean","default":true}}},"Message":{"type":"object","properties":{"id":{"type":"integer"},"direction":{"type":"string"},"kind":{"type":"string"},"status":{"type":"string","enum":["queued","scheduled","accepted","sending","sent","delivered","undelivered","failed","blocked","received"]},"from":{"type":"string"},"to":{"type":"string"},"body":{"type":"string","nullable":true},"media":{"type":"array","items":{"type":"string"}},"segments":{"type":"integer"},"price":{"type":"string","nullable":true},"error":{"type":"object","nullable":true},"client_ref":{"type":"string","nullable":true},"created_at":{"type":"string"},"sent_at":{"type":"string","nullable":true},"delivered_at":{"type":"string","nullable":true}}},"Lookup":{"type":"object","properties":{"phone":{"type":"string"},"valid":{"type":"boolean"},"carrier":{"type":"string","nullable":true},"line_type":{"type":"string","enum":["mobile","landline","voip","tollfree","unknown","invalid"]},"deliverable":{"type":"boolean"},"price":{"type":"string"}}}}}}