Skip to main content
POST
/
graphs
JavaScript
import Tractorbeam from 'tractorbeam';

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

async function main() {
  const graph = await client.graphs.create({ name: 'name' });

  console.log(graph.created_at);
}

main();
{
  "owner": "user_2iUTLb0XHlGHjewuVZVeZuF3Btt",
  "name": "my-graph-123",
  "created_at": "2023-11-14T12:34:56.000Z",
  "tuple_count": 100
}

Authorizations

Authorization
string
header
required

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

Body

application/json
name
string
required

Response

200 - application/json

Graph created successfully

owner
string
required

The owner of the graph, in the format "user_{id}" or "org_{id}"

Example:

"user_2iUTLb0XHlGHjewuVZVeZuF3Btt"

name
string
required

The name of the graph, must match regex: ^[\w.-]{1,64}$

Example:

"my-graph-123"

created_at
string
required

The creation timestamp in ISO 8601 format

Example:

"2023-11-14T12:34:56.000Z"

tuple_count
integer | null

The number of tuples in the graph

Required range: x >= 0
Example:

100