API reference · Keys
Create a key
POST https://payday.direct/api/v1 /keysCopy
Requests a key and shows it once. Needs a payday.direct account signed in with X, sent as JSON, with purpose saying what the key is for. The key answers key_pending until Payday approves it; launch: true asks for launching, granted at approval.
No API key. Uses your payday.direct sign-in.
labelstring
A name for the key
purposestring required
What the key is for. Payday reads it before approving the key.
launchboolean default false
Ask for a key that can launch coins. Granted, or not, at approval.
201 Requested: the key is shown once and waits for approval (status pending)
400 purpose_required, purpose_too_long or too_many_keys
401 Not signed in
403 x_required: the account is not signed in with X
415 Not sent as JSON
429 Too many new keys
cURL JavaScript Python Copy
curl -X POST "https://payday.direct/api/v1/keys" \
-H "Content-Type: application/json" \
-d '{"label":"My terminal","purpose":"Show fee recipients in my terminal","launch":false}' const res = await fetch("https://payday.direct/api/v1/keys", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"label": "My terminal",
"purpose": "Show fee recipients in my terminal",
"launch": false
}),
});
const json = await res.json();
if (!res.ok) throw new Error(json.error?.code);
console.log(json);import os, requests
r = requests.post(
"https://payday.direct/api/v1/keys",
json={
"label": "My terminal",
"purpose": "Show fee recipients in my terminal",
"launch": False
},
)
r.raise_for_status()
print(r.json())Response 201 Copy
{
"id" : "pd_aB3dE9xQ" ,
"key" : "pd_aB3dE9xQ...SHOWN_ONCE" ,
"label" : "My terminal" ,
"purpose" : "Show fee recipients in my terminal" ,
"status" : "pending" ,
"limit_per_minute" : 600 ,
"can_launch" : false ,
"launch_requested" : false ,
"signed_in" : true ,
"note" : "Copy this key now. It is shown only once. It works once Payday approves it."
}