Retrieve the API key's environment

GET
/v1/environment

Which environment, project and organization the API key belongs to, and the key itself. Any valid key can read its own environment (no permission needed): use it to check a key and show where it sends.

Authorization

bearerAuth
headerAuthorizationBearer <token>

A secret API key from the dashboard: coss_live_… for production environments, coss_test_… for sandbox environments.

Header Parameters

Coss-Version?"2026-10-10"

The API version (a date) to use for this request. Defaults to your organization's version, pinned to the latest one when it first used the API and upgraded from the dashboard. The SDK always sends the version it was built for.

Value in"2026-10-10"

Response Body

The API key's environment.

application/json
  1. response

The environment an API key belongs to, with its project and organization.

object*"environment"
Value in"environment"
id*string

The environment's id.

name*string
slug*string
mode*string

live delivers email; sandbox (coss_test_ keys) never does.

Value in"live""sandbox"
project*
organization*
api_key*

The API key making this request.

import { Coss } from "coss";const coss = new Coss({  apiKey: process.env.COSS_API_KEY,  baseUrl: "https://api.coss.com",});const { data, error } = await coss.environment.get();
{  "object": "environment",  "id": "env_01k7c8m4q2f3e9v6t5r1n0p8yz",  "name": "Development",  "slug": "development",  "mode": "sandbox",  "project": {    "id": "proj_01k7c8m4q2f3e9v6t5r1n0p8yz",    "name": "Default",    "slug": "default"  },  "organization": {    "id": "org_01k7c8m4q2f3e9v6t5r1n0p8yz",    "name": "Acme",    "slug": "acme",    "api_version": "2026-10-10"  },  "api_key": {    "id": "key_01k7c8m4q2f3e9v6t5r1n0p8yz",    "name": "Backend",    "start": "coss_test_Ab"  }}