सामग्री पर जाएँ

पब्लिक API संदर्भ

टिकट, मैसेज और एक्शन के लिए endpoints, scopes और उदाहरण।

स्कोप्ड API keys से अपने सिस्टम से omnichannel tickets और actions प्रबंधित करें।

बेस URL

सभी अनुरोध पब्लिक गेटवे से जाते हैं।

https://api.threada.ai

ऑथेंटिकेशन

  • `X-Api-Key` हेडर में API key भेजें।
  • Admin → API keys में keys बनाएं और rotate करें; प्रति integration एक key रखें।
  • Keys टेनेंट‑स्कोप्ड हैं और scopes के जरिए least‑privilege लागू करती हैं।

Scopes

  • `support.read` — tickets, messages और actions सूची/प्राप्त करें।
  • `support.write` — tickets create/update करें और messages जोड़ें।
  • `support.actions` — actions चलाएं और status देखें।

Pagination

  • List endpoints `limit` और `page_token` स्वीकारते हैं।
  • अगली request में `next_page_token` दें।

त्रुटियाँ

  • Errors `{ error: { type, message, code } }` लौटाते हैं।
  • HTTP status codes `code` मान के अनुरूप होते हैं।

Request/Response उदाहरण

टिकट सूची

सभी चैनलों में खुले tickets प्राप्त करें।

अनुरोध
curl -X GET "https://api.threada.ai/api/v1/public/tickets?limit=25" \
  -H "X-Api-Key: YOUR_API_KEY"
प्रतिक्रिया
{
  "items": [
    {
      "ticket_id": "TICKET_ID",
      "tenant_id": "TENANT_ID",
      "subject": "SUBJECT",
      "status": "open",
      "priority": "normal",
      "channel": "email",
      "tags": ["vip", "returns"],
      "last_message_at": "2026-02-04T18:32:11Z"
    }
  ],
  "next_page_token": "NEXT_PAGE_TOKEN"
}

टिकट बनाएं

प्रारंभिक संदेश के साथ नया ticket खोलें।

अनुरोध
curl -X POST "https://api.threada.ai/api/v1/public/tickets" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "subject": "SUBJECT",
    "priority": "normal",
    "channel": "email",
    "contact": {
      "name": "CUSTOMER_NAME",
      "email": "customer@example.com"
    },
    "tags": ["returns"],
    "initial_message": {
      "role": "user",
      "content": "MESSAGE_BODY",
      "external_message_id": "EXT_MSG_ID"
    }
  }'
प्रतिक्रिया
{
  "ticket": {
    "summary": {
      "ticket_id": "TICKET_ID",
      "tenant_id": "TENANT_ID",
      "subject": "SUBJECT",
      "status": "open",
      "priority": "normal",
      "channel": "email",
      "tags": ["returns"],
      "created_at": "2026-02-04T18:32:11Z"
    },
    "contact": {
      "name": "CUSTOMER_NAME",
      "email": "customer@example.com"
    },
    "messages": [
      {
        "message_id": "MESSAGE_ID",
        "role": "user",
        "content": "MESSAGE_BODY",
        "channel": "email",
        "created_at": "2026-02-04T18:32:11Z"
      }
    ]
  }
}

एक्शन चलाएं

टिकट के लिए custom HTTP automation ट्रिगर करें।

अनुरोध
curl -X POST "https://api.threada.ai/api/v1/public/tickets/TICKET_ID/actions" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "payload": {
      "type": "custom_http",
      "method": "POST",
      "url": "/hooks/zapier",
      "headers": {
        "X-Source": "threada"
      },
      "body_json": "{\"event\":\"ticket_updated\"}"
    }
  }'
प्रतिक्रिया
{
  "action": {
    "action_id": "ACTION_ID",
    "tenant_id": "TENANT_ID",
    "ticket_id": "TICKET_ID",
    "action_type": "custom_http",
    "status": "succeeded",
    "requested_by": "api_key:API_KEY_ID",
    "payload": {
      "type": "custom_http",
      "method": "POST",
      "url": "/hooks/zapier",
      "headers": {
        "X-Source": "threada"
      },
      "body_json": "{\"event\":\"ticket_updated\"}"
    }
  }
}

और endpoints चाहिए?

विस्तृत एक्सेस, ऊँची लिमिट्स और एंटरप्राइज़ SLA के लिए संपर्क करें।

सेल्स से संपर्क करें