API reference / Native /v1
Read-only keys
Native /v1. Generated from the OpenAPI document the services export (/openapi.json).
Samples use the placeholders YOUR_API_KEY and YOUR_ACCOUNT_ID.
Paste a sandbox key (twsk_…) to fill them in and to use Try it.
It stays in this browser tab and is only sent to the sandbox, never to the live API.
Try it is off in this build: No sandbox URL is configured for this build of the docs.
GET /v1/readonly-keys
List read-only keys Auth: X-API-Key
List your read-only keys. Values are never shown here, only key_preview.
Needs a full key, even to read.
Responses
200Your read-only keys. ·ReadonlyKey[]401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error
curl
curl -sS -X GET 'https://api.tickwire.io/v1/readonly-keys' \
-H 'X-API-Key: YOUR_API_KEY' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"GET",
"/v1/readonly-keys",
)
print(result) TypeScript
import { TickwireClient } from "@tickwire/sdk";
const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/v1/readonly-keys");
console.log(result);
tw.close(); Try it in the sandbox
Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.
POST /v1/readonly-keys
Create a read-only key Idempotency-Key Auth: X-API-Key
Create a read-only key. key is shown once and can't be shown again. With
Idempotency-Key a replay creates nothing and answers key: null
with a key_notice saying it was already shown.
| Parameter | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | null |
Request body CreateReadonlyKey required
| Field | Type | Description |
|---|---|---|
name required | string | |
scope | "all" | "selected" | |
account_ids | string[] |
Responses
201The new key, with its value shown once. ·ReadonlyKey400Bad request: a header or the body is not valid. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope409Conflict: the Idempotency-Key was used with another body, a request with the same key is still running, or the resource is in a state that does not allow this. ·ErrorEnvelope422A path, query or body parameter is not valid.detailslists each one. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error409idempotency_conflict
curl
curl -sS -X POST 'https://api.tickwire.io/v1/readonly-keys' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Idempotency-Key: my-request-1' \
-H 'Content-Type: application/json' \
-d '{"name":"example","scope":"all"}' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"POST",
"/v1/readonly-keys",
json={"name": "example", "scope": "all"},
idempotency_key="my-request-1",
reason="why you are doing this",
)
print(result) TypeScript
import { TickwireClient } from "@tickwire/sdk";
const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("POST", "/v1/readonly-keys", {
body: {"name":"example","scope":"all"},
idempotencyKey: "my-request-1",
reason: "why you are doing this",
});
console.log(result);
tw.close(); Try it in the sandbox
Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.
GET /v1/readonly-keys/{key_id}
Get a read-only key Auth: X-API-Key
Get one read-only key. The value is never shown here, only key_preview.
| Parameter | In | Type | Description |
|---|---|---|---|
key_id required | path | string |
Responses
200The key, without its value. ·ReadonlyKey401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope404The account or resource in the path does not exist, or this credential cannot see it. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error
curl
curl -sS -X GET 'https://api.tickwire.io/v1/readonly-keys/KEY_ID' \
-H 'X-API-Key: YOUR_API_KEY' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"GET",
"/v1/readonly-keys/KEY_ID",
)
print(result) TypeScript
import { TickwireClient } from "@tickwire/sdk";
const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("GET", "/v1/readonly-keys/KEY_ID");
console.log(result);
tw.close(); Try it in the sandbox
Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.
PATCH /v1/readonly-keys/{key_id}
Update a read-only key Auth: X-API-Key
Change a read-only key's name, scope or accounts. The value stays the same.
| Parameter | In | Type | Description |
|---|---|---|---|
key_id required | path | string |
Request body PatchReadonlyKey required
| Field | Type | Description |
|---|---|---|
name | string | null | |
scope | "all" | "selected" | null | |
account_ids | string[] | null |
Responses
200The updated key. ·ReadonlyKey400Bad request: a header or the body is not valid. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope404The account or resource in the path does not exist, or this credential cannot see it. ·ErrorEnvelope409Conflict: the Idempotency-Key was used with another body, a request with the same key is still running, or the resource is in a state that does not allow this. ·ErrorEnvelope422A path, query or body parameter is not valid.detailslists each one. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error
curl
curl -sS -X PATCH 'https://api.tickwire.io/v1/readonly-keys/KEY_ID' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{}' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"PATCH",
"/v1/readonly-keys/KEY_ID",
json={},
idempotency_key="my-request-1",
reason="why you are doing this",
)
print(result) TypeScript
import { TickwireClient } from "@tickwire/sdk";
const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("PATCH", "/v1/readonly-keys/KEY_ID", {
body: {},
idempotencyKey: "my-request-1",
reason: "why you are doing this",
});
console.log(result);
tw.close(); Try it in the sandbox
Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.
DELETE /v1/readonly-keys/{key_id}
Delete a read-only key Auth: X-API-Key
Delete a read-only key. It stops working at once.
| Parameter | In | Type | Description |
|---|---|---|---|
key_id required | path | string |
Responses
204The key was deleted.401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope404The account or resource in the path does not exist, or this credential cannot see it. ·ErrorEnvelope409Conflict: the Idempotency-Key was used with another body, a request with the same key is still running, or the resource is in a state that does not allow this. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error
curl
curl -sS -X DELETE 'https://api.tickwire.io/v1/readonly-keys/KEY_ID' \
-H 'X-API-Key: YOUR_API_KEY' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"DELETE",
"/v1/readonly-keys/KEY_ID",
idempotency_key="my-request-1",
reason="why you are doing this",
)
print(result) TypeScript
import { TickwireClient } from "@tickwire/sdk";
const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("DELETE", "/v1/readonly-keys/KEY_ID", {
idempotencyKey: "my-request-1",
reason: "why you are doing this",
});
console.log(result);
tw.close(); Try it in the sandbox
Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.
POST /v1/readonly-keys/{key_id}/rotate
Rotate a read-only key Idempotency-Key Auth: X-API-Key
Issue a new value for a read-only key (same id, scope and accounts);
the old value stops working. The new key is shown once
(key_notice). With Idempotency-Key a replay rotates nothing and
answers key: null with a key_notice saying it was already shown;
the same Idempotency-Key on another key's rotate answers 409
idempotency_conflict.
| Parameter | In | Type | Description |
|---|---|---|---|
key_id required | path | string | |
Idempotency-Key | header | string | null |
Responses
200The key, with its new value shown once. ·ReadonlyKey400Bad request: a header or the body is not valid. ·ErrorEnvelope401No credential was sent, or it is not valid or has expired. ·ErrorEnvelope403The credential is valid but may not do this, for example a read-only key on a change, or a token without the needed role or account. ·ErrorEnvelope404The account or resource in the path does not exist, or this credential cannot see it. ·ErrorEnvelope409Conflict: the Idempotency-Key was used with another body, a request with the same key is still running, or the resource is in a state that does not allow this. ·ErrorEnvelope422A path, query or body parameter is not valid.detailslists each one. ·ErrorEnvelope429Too many requests. Wait theRetry-Afterseconds, then try again. ·ErrorEnvelope
Errors (common for this kind of call; every error uses one envelope)
401unauthorized429rate_limited400, 422validation_error409idempotency_conflict
curl
curl -sS -X POST 'https://api.tickwire.io/v1/readonly-keys/KEY_ID/rotate' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Idempotency-Key: my-request-1' Python
from tickwire import Tickwire
with Tickwire("https://api.tickwire.io", "YOUR_API_KEY") as tw:
result = tw.request(
"POST",
"/v1/readonly-keys/KEY_ID/rotate",
idempotency_key="my-request-1",
reason="why you are doing this",
)
print(result) TypeScript
import { TickwireClient } from "@tickwire/sdk";
const tw = new TickwireClient({ baseUrl: "https://api.tickwire.io", token: "YOUR_API_KEY" });
const result = await tw.request("POST", "/v1/readonly-keys/KEY_ID/rotate", {
idempotencyKey: "my-request-1",
reason: "why you are doing this",
});
console.log(result);
tw.close(); Try it in the sandbox
Try it is off in this build of the docs: no sandbox URL is configured. The samples above work against the sandbox with your sandbox key.