Skip to main content
POST
/
v2
/
workspace
/
get
Get Workspace
curl --request POST \
  --url https://api.velt.dev/v2/workspace/get \
  --header 'Content-Type: application/json' \
  --header 'x-velt-workspace-auth-token: <x-velt-workspace-auth-token>' \
  --header 'x-velt-workspace-id: <x-velt-workspace-id>' \
  --data '{
  "data": {}
}'
import requests

url = "https://api.velt.dev/v2/workspace/get"

payload = { "data": {} }
headers = {
"x-velt-workspace-id": "<x-velt-workspace-id>",
"x-velt-workspace-auth-token": "<x-velt-workspace-auth-token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
'x-velt-workspace-id': '<x-velt-workspace-id>',
'x-velt-workspace-auth-token': '<x-velt-workspace-auth-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({data: {}})
};

fetch('https://api.velt.dev/v2/workspace/get', 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.velt.dev/v2/workspace/get",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [

]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-velt-workspace-auth-token: <x-velt-workspace-auth-token>",
"x-velt-workspace-id: <x-velt-workspace-id>"
],
]);

$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.velt.dev/v2/workspace/get"

payload := strings.NewReader("{\n \"data\": {}\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-velt-workspace-id", "<x-velt-workspace-id>")
req.Header.Add("x-velt-workspace-auth-token", "<x-velt-workspace-auth-token>")
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.post("https://api.velt.dev/v2/workspace/get")
.header("x-velt-workspace-id", "<x-velt-workspace-id>")
.header("x-velt-workspace-auth-token", "<x-velt-workspace-auth-token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.velt.dev/v2/workspace/get")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-velt-workspace-id"] = '<x-velt-workspace-id>'
request["x-velt-workspace-auth-token"] = '<x-velt-workspace-auth-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "result": {
    "status": "success",
    "message": "Workspace retrieved successfully",
    "data": {
      "id": "workspace_abc123",
      "name": "My Workspace",
      "owner": {
        "email": "owner@example.com",
        "id": "owner_id_123",
        "name": "John Doe",
        "avatar": "https://example.com/avatar.png"
      },
      "authToken": "9a1b2c3d4e5f60718293a4b5c6d7e8f9",
      "apiKeyList": {
        "velt_api_key_1": {
          "apiKeyName": "Owner Test API Key",
          "id": "velt_api_key_1",
          "type": "testing"
        }
      }
    }
  }
}
Use this API to retrieve details of an existing Velt workspace.
This endpoint uses workspace-level auth: pass x-velt-workspace-id and x-velt-workspace-auth-token (from the Create Workspace response) as headers.

Endpoint

POST https://api.velt.dev/v2/workspace/get

Headers

x-velt-workspace-id
string
required
Your workspace ID.
x-velt-workspace-auth-token
string
required
Your workspace Auth Token.

Body

Params

data
object
required
Empty data object.

Example Request

{
  "data": {}
}

Example Response

Success Response

{
  "result": {
    "status": "success",
    "message": "Workspace retrieved successfully",
    "data": {
      "id": "workspace_abc123",
      "name": "My Workspace",
      "owner": {
        "email": "owner@example.com",
        "id": "owner_id_123",
        "name": "John Doe",
        "avatar": "https://example.com/avatar.png"
      },
      "authToken": "9a1b2c3d4e5f60718293a4b5c6d7e8f9",
      "apiKeyList": {
        "velt_api_key_1": {
          "apiKeyName": "Owner Test API Key",
          "id": "velt_api_key_1",
          "type": "testing"
        }
      }
    }
  }
}
apiKeyList is a keyed object (not an array). Each key is the API key ID. To extract the first API key, use Object.keys(result.data.apiKeyList)[0] in JavaScript or iterate over the object keys.

Failure Response

If workspace not found
{
  "error": {
    "status": "NOT_FOUND",
    "message": "Workspace not found."
  }
}
If the workspace ID header is missing
{
  "error": {
    "status": "INVALID_ARGUMENT",
    "message": "Workspace ID not found in headers."
  }
}
If the auth token header is missing
{
  "error": {
    "status": "INVALID_ARGUMENT",
    "message": "Auth Token not found in headers."
  }
}
If the auth token is invalid
{
  "error": {
    "status": "UNAUTHENTICATED",
    "message": "Invalid auth token for workspace."
  }
}
If rate limit exceeded
{
  "error": {
    "status": "RESOURCE_EXHAUSTED",
    "message": "Rate limit exceeded. Try again after 1 minute."
  }
}
{
  "result": {
    "status": "success",
    "message": "Workspace retrieved successfully",
    "data": {
      "id": "workspace_abc123",
      "name": "My Workspace",
      "owner": {
        "email": "owner@example.com",
        "id": "owner_id_123",
        "name": "John Doe",
        "avatar": "https://example.com/avatar.png"
      },
      "authToken": "9a1b2c3d4e5f60718293a4b5c6d7e8f9",
      "apiKeyList": {
        "velt_api_key_1": {
          "apiKeyName": "Owner Test API Key",
          "id": "velt_api_key_1",
          "type": "testing"
        }
      }
    }
  }
}