c.l.cladDocs

Quickstart

Send your first authenticated query, create an issue, and read it back.

Send your first authenticated query, then create an issue.

1. Confirm your key works

curl https://clad-server-production.up.railway.app/graphql \
  -H "Authorization: Bearer clad_mk_..." \
  -H "Content-Type: application/json" \
  -d '{"query":"query { apiInfo }"}'

2. Create an issue

curl https://clad-server-production.up.railway.app/graphql \
  -H "Authorization: Bearer clad_mk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "query": "mutation Create($input: CreateIssueInput!) { createIssue(input: $input) { issue { id ticketNumber } error { code message } } }",
    "variables": {
      "input": {
        "subject": "Cannot reset my password",
        "body": "The reset email never arrives.",
        "requesterEmail": "jane@example.com",
        "requesterName": "Jane Doe",
        "priority": "high"
      }
    }
  }'

A successful response returns the created issue's global id and ticket number:

{
  "data": {
    "createIssue": {
      "issue": { "id": "SXNzdWU6...", "ticketNumber": 1024 },
      "error": null
    }
  }
}

3. Read it back

query GetIssue($id: ID!) {
  issue(id: $id) {
    id
    ticketNumber
    subject
    status
    priority
    messages(first: 20) {
      edges { node { senderName body createdAt } }
    }
  }
}