Project Users

Act as a project user from the SDKs

The bevor-user-id header:

An API key is scoped to one project. In an integration project, requests must also identify the project user they act for. Send that user's Bevor id in the bevor-user-id header.

Use the id returned by projects.users.create, not your application's external_id.

projects.get and projects.users.create do not require this header. Other integration-project calls do.

TypeScript

Set it for every request:

import { BevorClient } from "@bevorai/sdk";

const client = new BevorClient({
  apiKey: process.env.BEVOR_API_KEY!,
});

const headers = { "bevor-user-id": bevorUserId };

const analysis = await client.analyses.get(analysisId, undefined, {
  headers,
});

Or set it as a client default when the client represents one user:

const client = new BevorClient({
  apiKey: process.env.BEVOR_API_KEY!,
  defaultHeaders: { "bevor-user-id": bevorUserId },
});

const analyses = await client.analyses.list();

Python

Pass it to each call:

from bevor_sdk import AsyncBevorClient

client = AsyncBevorClient(api_key=api_key)
headers = {"bevor-user-id": bevor_user_id}

analysis = await client.analyses.get(
    analysis_id,
    headers=headers,
)

Or configure it once for a client that represents one user:

from bevor_sdk import AsyncBevorClient

client = AsyncBevorClient(
    api_key=api_key,
    default_headers={"bevor-user-id": bevor_user_id},
)

analyses = await client.analyses.list()

The synchronous BevorClient accepts the same default_headers and per-call headers arguments.

On this page