Skip to main content
POST
/
records
/
{recordId}
/
tags
JavaScript
import Scorecard from 'scorecard-ai';

const client = new Scorecard({
  apiKey: process.env['SCORECARD_API_KEY'], // This is the default and can be omitted
});

const recordTag = await client.records.tags.create('777', { text: 'urgent' });

console.log(recordTag.id);
{
  "id": "1",
  "recordId": "777",
  "text": "urgent",
  "source": "user",
  "userId": "user_abc123",
  "createdAt": "2026-03-01T12:00:00.000Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

recordId
string
required

The ID of the Record to tag.

Example:

"777"

Body

application/json
text
string
required

The tag text to apply. Idempotent: re-applying an existing tag is a no-op.

Response

The created (or existing) tag.

An arbitrary tag applied to a Record (e.g. urgent, regression, env:prod), either by a user or lifted from OTel span attributes at ingest.

id
string
required

The ID of the tag.

recordId
string
required

The ID of the Record this tag belongs to.

text
string
required

The tag text. May encode key:value semantics with a colon (e.g. env:prod).

source
enum<string>
required

How the tag was applied: user (UI, SDK, or REST) or otel (lifted from a span attribute at ingest).

Available options:
user,
otel
userId
string | null
required

The ID of the user who applied the tag; null for OTel-sourced tags.

createdAt
string
required

The ISO 8601 timestamp when the tag was created.