Create an access token
POST/v1/auth/access_token
This route allows you to create an access token for your Port account. You can use this token to authenticate your requests to the Port API.
To obtain your client ID and client secret, go to your Port application, click on the ... button in the top right corner, then click Credentials.
Request
Request body schema (JSON)
{
"title": "Body",
"body": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"clientId": {
"type": "string",
"description": "Your Port client ID"
},
"clientSecret": {
"type": "string",
"description": "Your Port client secret"
}
},
"additionalProperties": false,
"required": [
"clientId",
"clientSecret"
]
}
}
},
"required": true
}
}Responses
- 200
- 401
- 404
- 413
- 422
Authorized successfully
Default Response
A resource with the provided identifier was not found
Request body is too large (limit is 1MiB)
The json provided does not match the route's schema
Responses (JSON)
{
"responses": {
"200": {
"description": "Authorized successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"ok": {
"enum": [
true
]
},
"accessToken": {
"type": "string"
},
"expiresIn": {
"type": "number",
"description": "The number of seconds until the access token expires"
},
"tokenType": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"accessToken",
"expiresIn",
"tokenType"
],
"description": "Authorized successfully"
}
}
}
},
"401": {
"description": "Default Response",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error"
],
"additionalProperties": false
}
}
}
},
"404": {
"description": "A resource with the provided identifier was not found",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error",
"message"
],
"additionalProperties": false,
"description": "A resource with the provided identifier was not found"
}
}
}
},
"413": {
"description": "Request body is too large (limit is 1MiB)",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error"
],
"additionalProperties": false,
"description": "Request body is too large (limit is 1MiB)"
}
}
}
},
"422": {
"description": "The json provided does not match the route's schema",
"content": {
"application/json": {
"schema": {
"properties": {
"ok": {
"const": false
},
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"ok",
"error",
"message"
],
"additionalProperties": false,
"description": "The json provided does not match the route's schema"
}
}
}
}
}
}