> ## Documentation Index
> Fetch the complete documentation index at: https://docs.physionlabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Support requests and API keys

> Open and answer support requests from code; manage API keys in the console.

## Support requests

Ask NexCloud for help from code, optionally about one run. Replies come in the request's thread and by email to the
person who opened it (for an API key, the person who made the key). An organisation can open 10 a day.

| Call | Does |
| - | - |
| `POST /v1/support` `{"subject", "body", "run_id"?}` | opens a request; `run_id` is a job, an RL run or an inference run |
| `GET /v1/support` | your organisation's requests, latest activity first |
| `GET /v1/support/{id}` | one request with its `messages` |
| `POST /v1/support/{id}/messages` `{"body"}` | writes in the thread; a closed request opens again |
| `POST /v1/support/{id}/close` | closes it |

```bash curl theme={null}
curl https://nexcloud.physionlabs.ai/v1/support \
  -H "Authorization: Bearer $NEXTRON_API_KEY" -H "Content-Type: application/json" \
  -d '{"subject": "Job failed at step 3", "body": "What happened?", "run_id": "job_26c2f39989634135"}'
```

```python Python theme={null}
ticket = client.support.create("Job failed at step 3", "What happened?", run_id="job_26c2f39989634135")
client.support.get(ticket.id).messages
client.support.reply(ticket.id, "It also fails with a smaller batch.")
client.support.close(ticket.id)
```

```bash CLI theme={null}
nextron-cloud support open --subject "Job failed at step 3" --body "What happened?" --run job_26c2f39989634135
nextron-cloud support list
nextron-cloud support get <id>
nextron-cloud support reply <id> --body "It also fails with a smaller batch."
nextron-cloud support close <id>
```

A request has an `id`, `subject`, `status`, `run_id` and, read one at a time, its `messages`: each with `from`
(`customer` or `nexcloud`), `author`, `body` and `at`. `status` is `open` (NexCloud's turn), `answered` (yours) or
`closed`.

## API keys

Keys are managed in the [console](https://nexcloud.physionlabs.ai) on the **API keys** page, by a signed-in person.
These endpoints answer a console session only: called with an API key they return 403 `api_key_not_allowed`.

| Call | Does |
| - | - |
| `GET /v1/keys` | your organisation's keys: `id`, `name`, `prefix`, `last4`, `created_at`, `last_used_at`. Never the secret |
| `POST /v1/keys` `{"name"}` | a new key; its `secret` is returned once. Organisation owners only |
| `DELETE /v1/keys/{id}` | revokes a key |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.