curl --request GET \
--url https://api.stackone.com/v2/accounts/{id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.stackone.com/v2/accounts/{id}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.stackone.com/v2/accounts/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.stackone.com/v2/accounts/{id}")
.header("Authorization", "Basic <encoded-value>")
.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::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
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>"
],
"effects": [
"read"
],
"enabled": true,
"sync_available": true
}
],
"events": {
"native": [
{
"id": "<string>",
"label": "<string>",
"description": "<string>",
"requires_manual_setup": true
}
],
"synced": [
{
"action_id": "<string>",
"label": "<string>",
"events": [
{
"id": "<string>",
"change": "added"
}
],
"cadence": "PT15M"
}
]
},
"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"
}Get an account
Returns a single linked account, including when it was connected.
curl --request GET \
--url https://api.stackone.com/v2/accounts/{id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.stackone.com/v2/accounts/{id}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.stackone.com/v2/accounts/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.stackone.com/v2/accounts/{id}")
.header("Authorization", "Basic <encoded-value>")
.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::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
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>"
],
"effects": [
"read"
],
"enabled": true,
"sync_available": true
}
],
"events": {
"native": [
{
"id": "<string>",
"label": "<string>",
"description": "<string>",
"requires_manual_setup": true
}
],
"synced": [
{
"action_id": "<string>",
"label": "<string>",
"events": [
{
"id": "<string>",
"change": "added"
}
],
"cadence": "PT15M"
}
]
},
"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
Query Parameters
A comma-separated list of additional fields to expand. Supported values: connector (the connector display data), connector_profile (the connector profile id and label), last_request (when the account was last active, counting both requests and action runs), actions (the connector action catalog, each flagged with whether it is enabled for this account's connector profile), and events (the MCP events available on the account now, native and per synced action). These are omitted (returned as null) unless requested, as resolving them is more expensive.
"connector,connector_profile,last_request,actions,events"
Response
The account was retrieved.
The MCP events available on the account now: native events and, per synced action, its change events. Empty when MCP events are off for the organization, when the account is inactive or its connector has no MCP events, or when the event catalogue could not be read (logged; retry later). Only present when requested via ?expand=events.
Show child attributes
Show child attributes
Was this page helpful?