Create an API key
POST
/v1/api_keys
const url = 'https://api.railflo.com/v1/api_keys';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"Referral integration (prod)","mode":"test","scopes":["exchanges:read"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.railflo.com/v1/api_keys \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Referral integration (prod)", "mode": "test", "scopes": [ "exchanges:read" ] }'Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
name
required
string
Example
Referral integration (prod)mode
required
string
Example
testscopes
Omit for all scopes.
Array<string>
Responses
Section titled “Responses”Created
Media typeapplication/json
object
id
required
string
name
required
string
last4
required
string
mode
required
string
scopes
required
Array<string>
created_at
required
string
last_used_at
required
string | null
revoked_at
required
string | null
secret
required
Shown exactly once — store it now, it cannot be retrieved again.
string
Example
{ "mode": "test", "scopes": [ "exchanges:read" ]}