SpartivoDocs
Open app
Get started
OverviewQuickstartAuthenticationRequests and errors
API reference
RecordsModules and fieldsFilesMessagingDocuments and e-signatureFunctionsWebhooks
Spartivo Script
IntroductionLanguage guideCRM and actionsBuilt-in functionsExamples
API reference

Modules and fields

Read the structure of the CRM: which modules exist and which fields each one has. Use it to build forms and mappings that keep working when an administrator adds a field.

List modules

GET/metadata/modules

Every module with its fields.

Request
curl "https://api.spartivo.com/api/v1/metadata/modules" \
  -H "Authorization: Bearer wk_your_key"
Response
[
  {
    "id": "b9fa0f66-a5bf-4c48-8637-2da3406419eb",
    "apiName": "leads",
    "label": "Lead",
    "pluralLabel": "Leads",
    "icon": "user-plus",
    "system": true,
    "features": {
      "pipeline": false,
      "documents": true,
      "activities": true,
      "conversations": true
    },
    "fields": [
      {
        "apiName": "email",
        "label": "Email",
        "type": "email",
        "required": false,
        "unique": false,
        "options": null,
        "lookupModule": null
      },
      {
        "apiName": "status",
        "label": "Status",
        "type": "picklist",
        "required": false,
        "unique": false,
        "options": [
          {
            "value": "new",
            "label": "New"
          },
          {
            "value": "contacted",
            "label": "Contacted"
          }
        ],
        "lookupModule": null
      }
    ]
  }
]

Get a module

GET/metadata/modules/{module}

One module with its fields.

Path parameters
modulestringrequired
The module's API name, for example leads, contacts, accounts, deals or one of your custom modules.
Request
curl "https://api.spartivo.com/api/v1/metadata/modules/deals" \
  -H "Authorization: Bearer wk_your_key"
Response
{
  "apiName": "deals",
  "label": "Deal",
  "pluralLabel": "Deals",
  "features": {
    "pipeline": true,
    "documents": true,
    "activities": true,
    "conversations": true
  },
  "fields": [
    {
      "apiName": "amount",
      "label": "Amount",
      "type": "currency",
      "required": false
    },
    {
      "apiName": "account",
      "label": "Account",
      "type": "lookup",
      "lookupModule": "accounts",
      "required": false
    }
  ]
}

Field types

TypeValue in data
text, long_text, rich_text, email, phone, urlstring
number, decimal, currency, percentnumber
checkboxtrue or false
datestring, YYYY-MM-DD
datetimestring, ISO 8601 in UTC
pickliststring: one of the field's option values
multi_pickliststring[]: option values
lookupstring: the id of a record in lookupModule
userstring: a user id
filestring: a file id from Upload a file
formula, auto_numberset by Spartivo; values you send are ignored

Add a field

POST/metadata/modules/{module}/fields

Adds a custom field to a module. The key's user needs the Customization permission in their profile.

Path parameters
modulestringrequired
The module's API name, for example leads, contacts, accounts, deals or one of your custom modules.
Body
apiNamestringrequired
Lowercase letters, numbers and underscores, starting with a letter.
labelstringrequired
The name people see.
typestringrequired
One of the field types above.
requiredboolean
Refuse records without a value.
uniqueboolean
Refuse a value another record already has.
optionsobject[]
For picklists: [{"value":"gold","label":"Gold"}].
lookupModulestring
For lookups: the module the field points to.
Request
curl -X POST "https://api.spartivo.com/api/v1/metadata/modules/accounts/fields" \
  -H "Authorization: Bearer wk_your_key" \
  -H "Content-Type: application/json" \
  -d '{"apiName":"tier","label":"Tier","type":"picklist","options":[{"value":"gold","label":"Gold"},{"value":"silver","label":"Silver"}]}'
Response
{
  "apiName": "tier",
  "label": "Tier",
  "type": "picklist",
  "required": false,
  "unique": false,
  "options": [
    {
      "value": "gold",
      "label": "Gold"
    },
    {
      "value": "silver",
      "label": "Silver"
    }
  ]
}

List users

GET/users

People in the workspace. Use the ids for ownerId and for user fields.

Request
curl "https://api.spartivo.com/api/v1/users" \
  -H "Authorization: Bearer wk_your_key"
Response
[
  {
    "id": "035607f1-9fd1-44bc-ac7f-d5128d5afc22",
    "email": "sara@example.com",
    "fullName": "Sara Khalifa",
    "role": "admin",
    "active": true,
    "profile": {
      "id": "e827a63b-ff46-4580-b613-67742bf0c8e3",
      "name": "Administrator"
    },
    "orgRole": {
      "id": "d0a31443-908b-4493-9d6c-5a057e119cf2",
      "name": "CEO"
    }
  }
]
Previous← RecordsNextFiles →
On this page
GETList modulesGETGet a moduleField typesPOSTAdd a fieldGETList users