Create access token
POST
/oauth/token
const url = 'https://api.pipevest.com/v1/oauth/token';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"clientId":"org_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d","clientSecret":"1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d_9f8e7d6c5b4a3f2e1d0c9b8a7f6e5d4c"}'};
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.pipevest.com/v1/oauth/token \ --header 'Content-Type: application/json' \ --data '{ "clientId": "org_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d", "clientSecret": "1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d_9f8e7d6c5b4a3f2e1d0c9b8a7f6e5d4c" }'Exchange your clientId and clientSecret for a short-lived bearer
token. This is the only unauthenticated endpoint.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
clientId
required
string
Example
org_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6dclientSecret
required
string
Example
1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d_9f8e7d6c5b4a3f2e1d0c9b8a7f6e5d4cResponses
Section titled “Responses”Authentication successful
Media typeapplication/json
object
message
string
tokenId
string
token
Bearer JWT access token
string
expiresIn
TTL in seconds
integer
maxTTL
integer
tokenType
string
scope
Array<string>
trustedIps
Array<string>
organization
object
id
string
name
string
clientId
string
createdAt
Unix timestamp
integer
updatedAt
Unix timestamp
integer
Example
{ "message": "Authentication successful", "tokenId": "b0f6e2a1-9c3d-4e5f-8a7b-6c5d4e3f2a1b", "expiresIn": 3600, "maxTTL": 86400, "tokenType": "Bearer", "scope": [ "READ", "WRITE" ], "trustedIps": [], "organization": { "id": "clx0a1b2c3d4e5f6g7h8i9j0k", "name": "Acme Investments", "clientId": "org_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d" }, "createdAt": 1752566400, "updatedAt": 1752566400}Request failed schema validation
Media typeapplication/json
object
error
string
details
Array<object>
object
field
string
message
string
Example
{ "error": "Validation failed", "details": [ { "field": "firstName", "message": "First name is required" } ]}Invalid client credentials
Media typeapplication/json
object
error
string
message
string
Example
{ "error": "Unauthorized", "message": "Invalid client credentials"}