Skip to main content
GET
/
collections
/
{id}
JavaScript
import Moonbase from '@moonbaseai/sdk';

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

const collection = await client.collections.retrieve('id');

console.log(collection.id);
{
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"name": "People",
"ref": "people",
"core": true,
"fields": [
{
"id": "1CLJt2uvQDDDdcM5HLetAm",
"type": "field/relation",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"relation_type": "two_way",
"allowed_collections": [
{
"id": "1CLJt2ufGrzTByXJuNq13S",
"type": "collection",
"ref": "tasks"
}
],
"name": "Assigned Tasks",
"ref": "assigned_tasks",
"cardinality": "many",
"required": false,
"unique": false,
"readonly": false,
"core": true
},
{
"id": "1CLJt2v4qE2GXvyCuMLt99",
"type": "field/choice",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"options": [
{
"id": "1CLJt2v465RQonW8pU77np",
"type": "choice_field_option",
"name": "CEO Approval"
},
{
"id": "1CLJt2v4LTd2iVzVWmBhub",
"type": "choice_field_option",
"name": "CTO Approval"
},
{
"id": "1CLJt2v4aqpedDUrD4GJ2N",
"type": "choice_field_option",
"name": "Legal"
}
],
"name": "Buyer Criteria",
"ref": "buyer_criteria",
"description": "A field representing the internal approvals required before proceeding. Each selected value corresponds to a specific approval category. Possible values include:\n\"CEO Approval\" – Approval from the Chief Executive Officer\n\"CTO Approval\" – Approval from the Chief Technology Officer\n\"Legal\" – Approval or review by the Legal department\n",
"cardinality": "many",
"required": false,
"unique": false,
"readonly": false,
"core": false
},
{
"id": "1CLJt2utuv1WBKQw7aBMU7",
"type": "field/relation",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"relation_type": "two_way",
"allowed_collections": [
{
"id": "1CLJt2ue2wzMeQ5XRuS4TZ",
"type": "collection",
"ref": "deals"
}
],
"name": "Contact on Deals",
"ref": "contact_on_deals",
"cardinality": "many",
"required": false,
"unique": false,
"readonly": false,
"core": true
},
{
"id": "1CLJt2uc3tPQNgAfsYoMXM",
"type": "field/datetime",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"name": "Created At",
"ref": "created_at",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": true,
"core": true
},
{
"id": "1CLJt2v6pHdDoet4Thyb5M",
"type": "field/relation",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"relation_type": "two_way",
"allowed_collections": [
{
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
],
"name": "Decision Maker",
"ref": "decision_maker",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": false,
"core": false
},
{
"id": "1CLJt2uizbzjphrfKo1po5",
"type": "field/text/multi_line",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"name": "Description",
"ref": "description",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": false,
"core": true
},
{
"id": "1CLJt2ugWmzYjYy6NrDwdK",
"type": "field/email",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"name": "Email",
"ref": "email",
"cardinality": "many",
"required": false,
"unique": true,
"readonly": false,
"core": true
},
{
"id": "1CLJt2v1MsDbov8DBEEeWH",
"type": "field/number/monetary",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"name": "Estimate",
"ref": "estimate",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": false,
"core": false
},
{
"id": "1CLJt2ujz8oDTZp66yLBGB",
"type": "field/datetime",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"name": "First Call At",
"ref": "first_call_at",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": true,
"core": true
},
{
"id": "1CLJt2ujjkbbYrKjQgFb9Q",
"type": "field/datetime",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"name": "First Interaction At",
"ref": "first_interaction_at",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": true,
"core": true
},
{
"id": "1CLJt2ujVNPye8qNiPB12d",
"type": "field/datetime",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"name": "First Meeting At",
"ref": "first_meeting_at",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": true,
"core": true
},
{
"id": "1CLJt2ujEzCMjRM2266Qur",
"type": "field/datetime",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"name": "First Message At",
"ref": "first_message_at",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": true,
"core": true
},
{
"id": "1CLJt2uhkgzeH8QsrKctDC",
"type": "field/text/single_line",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"name": "Job Title",
"ref": "job_title",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": false,
"core": true
},
{
"id": "1CLJt2ukyfbh6RmWt9eXjH",
"type": "field/datetime",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"name": "Last Call At",
"ref": "last_call_at",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": true,
"core": true
},
{
"id": "1CLJt2ukjHQ5BiHABrZwcW",
"type": "field/datetime",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"name": "Last Interaction At",
"ref": "last_interaction_at",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": true,
"core": true
},
{
"id": "1CLJt2ukUuCTGznoVZVMVj",
"type": "field/datetime",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"name": "Last Meeting At",
"ref": "last_meeting_at",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": true,
"core": true
},
{
"id": "1CLJt2ukEWzqNHJSoGQmNx",
"type": "field/datetime",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"name": "Last Message At",
"ref": "last_message_at",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": true,
"core": true
},
{
"id": "1CLJt2ui15CGBquEYchUKy",
"type": "field/uri/social_linked_in",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"name": "LinkedIn Profile",
"ref": "linked_in_profile",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": false,
"core": true
},
{
"id": "1CLJt2uikDo7uzNJdVwEgJ",
"type": "field/geo",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"name": "Location",
"ref": "location",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": false,
"core": true
},
{
"id": "1CLJt2uboWBnTxgKBFimQa",
"type": "field/text/single_line",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"name": "Name",
"ref": "name",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": false,
"core": true
},
{
"id": "1CLJt2ugmACAeGTT59JXk6",
"type": "field/relation",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"relation_type": "two_way",
"allowed_collections": [
{
"id": "1CLJt2uco2zG6pdjxS37sg",
"type": "collection",
"ref": "organizations"
}
],
"name": "Organization",
"ref": "organization",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": false,
"core": true
},
{
"id": "1CLJt2urvrQYubW5ZDYeXu",
"type": "field/relation",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"relation_type": "two_way",
"allowed_collections": [
{
"id": "1CLJt2ue2wzMeQ5XRuS4TZ",
"type": "collection",
"ref": "deals"
}
],
"name": "Owned Deals",
"ref": "owned_deals",
"cardinality": "many",
"required": false,
"unique": true,
"readonly": false,
"core": true
},
{
"id": "1CLJt2v74fpqiNNRA14BC8",
"type": "field/relation",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"relation_type": "two_way",
"allowed_collections": [
{
"id": "1CLJt2ubZ7zAZFBxUxeBHo",
"type": "collection",
"ref": "people"
}
],
"name": "People",
"ref": "people",
"cardinality": "many",
"required": false,
"unique": true,
"readonly": false,
"core": true
},
{
"id": "1CLJt2uiVqbW1GswwCreZX",
"type": "field/telephone_number",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"name": "Phone",
"ref": "phone",
"cardinality": "many",
"required": false,
"unique": true,
"readonly": false,
"core": true
},
{
"id": "1CLJt2uwtWQw5uHDT78QsR",
"type": "field/relation",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"relation_type": "two_way",
"allowed_collections": [
{
"id": "1CLJt2ufGrzTByXJuNq13S",
"type": "collection",
"ref": "tasks"
}
],
"name": "Related Tasks",
"ref": "related_tasks",
"cardinality": "many",
"required": false,
"unique": false,
"readonly": false,
"core": true
},
{
"id": "1CLJt2v2MQ25Sn5dxQYzyP",
"type": "field/stage",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"funnel": {
"id": "1CLJt2v2bnDhMVZzehdb6A",
"type": "funnel",
"steps": [
{
"id": "1CLJt2v2rARKGD4MLziBCw",
"type": "funnel_step",
"step_type": "active",
"name": "Step 1"
},
{
"id": "1CLJt2v36YcwAvYi3HnmKi",
"type": "funnel_step",
"step_type": "active",
"name": "Step 2"
},
{
"id": "1CLJt2v3LvpZ5e34jasMSV",
"type": "funnel_step",
"step_type": "active",
"name": "Step 3"
},
{
"id": "1CLJt2v3bK2AzMXRRswwZG",
"type": "funnel_step",
"step_type": "success",
"name": "Step 4"
},
{
"id": "1CLJt2v3qhDnu51n8B2Xg3",
"type": "funnel_step",
"step_type": "failure",
"name": "Step 5"
}
]
},
"name": "Stage",
"ref": "stage",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": false,
"core": false
},
{
"id": "1CLJt2v17V1yuCdrUwA4PW",
"type": "field/text/single_line",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"name": "Text_(Single Line)",
"ref": "text_single_line_129",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": false,
"core": false
},
{
"id": "1CLJt2ucJGb2HPf2Zqswe8",
"type": "field/datetime",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"name": "Updated At",
"ref": "updated_at",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": true,
"core": true
},
{
"id": "1CLJt2uiFTPt6ZPbEun4Sk",
"type": "field/uri/social_x",
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z",
"name": "X Profile",
"ref": "x_profile",
"cardinality": "one",
"required": false,
"unique": false,
"readonly": false,
"core": true
}
],
"created_at": "2025-02-17T16:00:00.000Z",
"updated_at": "2025-02-17T16:00:00.000Z"
}

Authorizations

Authorization
string
header
required

Your Moonbase API key.

Path Parameters

id
string
required

The ID or ref of the Collection to retrieve.

Query Parameters

include[]
enum<string>[]

Specifies which related objects to include in the response.

Available options:
views

Response

Successful response.

A Collection is a container for structured data, similar to a database table or spreadsheet. It defines a schema using a set of Fields and holds the data as a list of Items.

type
string
required

String representing the object’s type. Always collection for this object.

Allowed value: "collection"
id
string
required

Unique identifier for the object.

name
string
required

The user-facing name of the collection (e.g., “Organizations”).

ref
string
required

A unique, stable, machine-readable identifier for the collection. This reference is used in API requests and does not change even if the name is updated.

core
boolean
required

If true, this is one of the foundational collections (People, Organizations, Deals, or Tasks).

fields
(SingleLineTextField · object | MultiLineTextField · object | IntegerField · object | FloatField · object | MonetaryField · object | PercentageField · object | BooleanField · object | EmailField · object | UrlField · object | DomainField · object | SocialXField · object | SocialLinkedInField · object | TelephoneNumberField · object | GeoField · object | DateField · object | DatetimeField · object | ChoiceField · object | StageField · object | RelationField · object)[]
required

A list of Field objects that define the schema for items in this collection.

A field definition, which varies by type

created_at
string<date-time>
required

Time at which the object was created, as an ISO 8601 timestamp in UTC.

updated_at
string<date-time>
required

Time at which the object was last updated, as an ISO 8601 timestamp in UTC.

description
string

An optional, longer-form description of the collection's purpose.

views
View · object[]

A list of saved View objects for presenting the collection's data.

Note: Only present when requested using the include query parameter.