Get current workspace
curl --request GET \
--url https://api.unif.dev/v1/me \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.unif.dev/v1/me"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.unif.dev/v1/me', 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.unif.dev/v1/me",
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: Bearer <token>"
],
]);
$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.unif.dev/v1/me"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.unif.dev/v1/me")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unif.dev/v1/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "workspace",
"id": "wsp_01k3m9x7v2q8r4t6y0b1n5d7fa",
"name": "<string>",
"api_key_id": "<string>",
"api_key_name": "<string>",
"environment": "live",
"channels": [
"tiktok_shop"
],
"rate_limit_per_minute": 123
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "No API key was provided in the Authorization header.",
"doc_url": "https://unif.dev/docs/platform/errors#invalid_api_key",
"request_id": "req_01k3m9x7v2q8r4t6y0b1n5d7fa"
}
}Meta
Get current workspace
Returns the workspace and key the request authenticated as, plus the channels the workspace is entitled to.
GET
https://api.unif.dev/v1
/
me
Get current workspace
curl --request GET \
--url https://api.unif.dev/v1/me \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.unif.dev/v1/me"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.unif.dev/v1/me', 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.unif.dev/v1/me",
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: Bearer <token>"
],
]);
$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.unif.dev/v1/me"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.unif.dev/v1/me")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unif.dev/v1/me")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "workspace",
"id": "wsp_01k3m9x7v2q8r4t6y0b1n5d7fa",
"name": "<string>",
"api_key_id": "<string>",
"api_key_name": "<string>",
"environment": "live",
"channels": [
"tiktok_shop"
],
"rate_limit_per_minute": 123
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "No API key was provided in the Authorization header.",
"doc_url": "https://unif.dev/docs/platform/errors#invalid_api_key",
"request_id": "req_01k3m9x7v2q8r4t6y0b1n5d7fa"
}
}Authorizations
Send your workspace API key as a bearer token:
Authorization: Bearer unif_sk_live_...
Keys are scoped to a single workspace. See Authentication.
Response
The authenticated workspace.
Allowed value:
"workspace"Example:
"wsp_01k3m9x7v2q8r4t6y0b1n5d7fa"
Available options:
live, sandbox A sales channel — the commerce surface a request is about. Behind each channel is a cascade of data sources, tried in cost order until one verifies; the roster is published, but which source answered a given row is not carried in the response, so the cascade can be re-tuned without breaking your code.
Available options:
tiktok_shop Was this page helpful?