curl --request PATCH \
--url https://api.stackone.com/v2/accounts/{id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"status_reasons": [
{
"timestamp": "2023-11-07T05:31:56Z",
"description": "<string>"
}
]
}
'import requests
url = "https://api.stackone.com/v2/accounts/{id}"
payload = { "status_reasons": [
{
"timestamp": "2023-11-07T05:31:56Z",
"description": "<string>"
}
] }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({status_reasons: [{timestamp: '2023-11-07T05:31:56Z', description: '<string>'}]})
};
fetch('https://api.stackone.com/v2/accounts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stackone.com/v2/accounts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'status_reasons' => [
[
'timestamp' => '2023-11-07T05:31:56Z',
'description' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.stackone.com/v2/accounts/{id}"
payload := strings.NewReader("{\n \"status_reasons\": [\n {\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"description\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.stackone.com/v2/accounts/{id}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"status_reasons\": [\n {\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"description\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stackone.com/v2/accounts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status_reasons\": [\n {\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"description\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"connector_key": "<string>",
"status": "active",
"status_reasons": [
{
"timestamp": "2023-11-07T05:31:56Z",
"code": "ACCOUNT_TOKEN_REFRESH_FAILURE",
"description": "<string>"
}
],
"owner_id": "<string>",
"name": "<string>",
"type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"connected_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"connector": {
"key": "<string>",
"logo_url": "<string>",
"categories": [
"<string>"
],
"owner": "<string>",
"name": "<string>",
"version": "<string>"
},
"connector_profile_id": "<string>",
"connector_profile_label": "<string>",
"last_request": "2023-11-07T05:31:56Z",
"actions": [
{
"id": "<string>",
"label": "<string>",
"description": "<string>",
"tags": [
"<string>"
],
"enabled": true,
"sync_available": true
}
],
"owner_username": "<string>"
}{
"statusCode": 400,
"message": "Bad Request",
"timestamp": "2023-05-30T00:00:00.000Z",
"data": {
"statusCode": 400,
"message": "Bad Request",
"headers": {
"content-type": "application/json",
"x-request-id": "5678c28b211dace4e0a0f9171e6b88c5"
}
},
"provider_errors": [
{
"status": 400,
"url": "https://api.provider.com/v1/resource",
"raw": {
"message": "Invalid input parameters"
},
"headers": {
"content-type": "application/json",
"x-request-id": "5678c28b211dace4e0a0f9171e6b88c5"
}
}
]
}{
"statusCode": 401,
"message": "Unauthorized",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 403,
"message": "Forbidden resource",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 404,
"message": "Not Found",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 408,
"message": "Request timed out",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 409,
"message": "Conflict",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 422,
"message": "Unprocessable Entity",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 429,
"message": "Too many requests",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 500,
"message": "Internal server error",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 501,
"message": "Not Implemented",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 502,
"message": "Bad Gateway",
"timestamp": "2023-05-30T00:00:00.000Z"
}Patch an account
Updates an account’s status and/or status reasons.
curl --request PATCH \
--url https://api.stackone.com/v2/accounts/{id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"status_reasons": [
{
"timestamp": "2023-11-07T05:31:56Z",
"description": "<string>"
}
]
}
'import requests
url = "https://api.stackone.com/v2/accounts/{id}"
payload = { "status_reasons": [
{
"timestamp": "2023-11-07T05:31:56Z",
"description": "<string>"
}
] }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({status_reasons: [{timestamp: '2023-11-07T05:31:56Z', description: '<string>'}]})
};
fetch('https://api.stackone.com/v2/accounts/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stackone.com/v2/accounts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'status_reasons' => [
[
'timestamp' => '2023-11-07T05:31:56Z',
'description' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.stackone.com/v2/accounts/{id}"
payload := strings.NewReader("{\n \"status_reasons\": [\n {\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"description\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.stackone.com/v2/accounts/{id}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"status_reasons\": [\n {\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"description\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stackone.com/v2/accounts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"status_reasons\": [\n {\n \"timestamp\": \"2023-11-07T05:31:56Z\",\n \"description\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"connector_key": "<string>",
"status": "active",
"status_reasons": [
{
"timestamp": "2023-11-07T05:31:56Z",
"code": "ACCOUNT_TOKEN_REFRESH_FAILURE",
"description": "<string>"
}
],
"owner_id": "<string>",
"name": "<string>",
"type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"connected_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"connector": {
"key": "<string>",
"logo_url": "<string>",
"categories": [
"<string>"
],
"owner": "<string>",
"name": "<string>",
"version": "<string>"
},
"connector_profile_id": "<string>",
"connector_profile_label": "<string>",
"last_request": "2023-11-07T05:31:56Z",
"actions": [
{
"id": "<string>",
"label": "<string>",
"description": "<string>",
"tags": [
"<string>"
],
"enabled": true,
"sync_available": true
}
],
"owner_username": "<string>"
}{
"statusCode": 400,
"message": "Bad Request",
"timestamp": "2023-05-30T00:00:00.000Z",
"data": {
"statusCode": 400,
"message": "Bad Request",
"headers": {
"content-type": "application/json",
"x-request-id": "5678c28b211dace4e0a0f9171e6b88c5"
}
},
"provider_errors": [
{
"status": 400,
"url": "https://api.provider.com/v1/resource",
"raw": {
"message": "Invalid input parameters"
},
"headers": {
"content-type": "application/json",
"x-request-id": "5678c28b211dace4e0a0f9171e6b88c5"
}
}
]
}{
"statusCode": 401,
"message": "Unauthorized",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 403,
"message": "Forbidden resource",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 404,
"message": "Not Found",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 408,
"message": "Request timed out",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 409,
"message": "Conflict",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 422,
"message": "Unprocessable Entity",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 429,
"message": "Too many requests",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 500,
"message": "Internal server error",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 501,
"message": "Not Implemented",
"timestamp": "2023-05-30T00:00:00.000Z"
}{
"statusCode": 502,
"message": "Bad Gateway",
"timestamp": "2023-05-30T00:00:00.000Z"
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
The unique identifier of the account.
Body
Response
The account was updated.
The unique identifier of the account.
The connector/provider key this account connects to (e.g. workday). Always present; the full connector object requires ?expand=connector.
The current status of the account.
active, inactive, suspended, archived, expired, error Reasons explaining the current status.
Show child attributes
Show child attributes
The account owner's identifier in the provider's system.
The account owner's name in the provider's system.
The account type (e.g. production or test).
When the account was created.
When the account was last updated.
When the account was connected to its integration; null if unknown.
When the account expires (test accounts only); null for production.
The connector this account uses. Only present when requested via ?expand=connector.
Show child attributes
Show child attributes
The identifier of the connector profile this account is linked to. Only present when requested via ?expand=connector_profile.
The connector profile label: the connector profile name, appended with the authentication label (e.g. Acme | Production). Only present when requested via ?expand=connector_profile.
When the account was last active, counting both requests and action runs. Only present when requested via ?expand=last_request.
The account's connector action catalog, each flagged with whether it is enabled for the connector profile. Only present when requested via ?expand=actions.
Show child attributes
Show child attributes
The end-user identifier within the owner, if any.
Was this page helpful?