Skip to content
Navigation

Get the CRM settings

GET
https://api.nicer.travel/crm/settings

Returns how the agency uses its CRM: the custom fields its travelers carry (the keys and types a traveler's customFields takes), its task templates (the templateId POST /crm/task-templates/{templateId}/apply takes), its saved segments (the segmentId GET /crm/travelers takes), who sees a new traveler by default, and its webhooks with the last four characters of each signing secret, never the secret itself. The revision is the one PUT /crm/settings needs; an agency that never saved its settings reads the defaults at revision 0. The agency's advisors and admins may read them. Errors: 403 ERROR_UNAUTHORIZED for a traveler.

Authorization

  • bearerAuth
    HTTP Bearer (JWT)
    required

    Authorization: Bearer <token>

Header parameters

  • x-nicer-company
    string
    required

    Company context. Authentication and tenant membership are validated by the API.

  • X-Nicer-CRM-Contract
    resource
    required
    example: "resource"

Returns

200

OK

JSON
  • companyName
    string
    required

    The agency the settings belong to.

  • customFields
    array of
    object
    required

    The fields the agency adds to its travelers.

    • key
      string
      required

      The key a traveler's value is stored under in their customFields, in camelCase: a lowercase letter, then up to 39 letters or digits, e.g. favoriteAirline. Unique among the agency's fields.

      pattern: ^[a-z][a-zA-Z0-9]{0,39}$
    • label
      string
      required

      The name the agency's screens show for the field, 1 to 60 characters.

      maxLength: 60 · minLength: 1
    • options
      array of
      string
      required

      The choices of a SELECT field, up to 30, each 1 to 60 characters; a traveler's value must be one of them. The other types ignore it: send an empty list.

      maxLength: 60 · minLength: 1
    • type
      BOOLEAN
      or
      DATE
      or
      NUMBER
      or
      SELECT
      or
      TEXT
      required

      The kind of value the field holds; a traveler's value that is not of this kind is refused.

  • defaultVisibility
    ADVISORS
    or
    COMPANY
    required

    Who sees a new traveler unless it says otherwise.

  • revision
    integer
    required

    The settings' revision, to send back with a change; 0 until the settings are saved for the first time.

    maximum: 9007199254740991 · minimum: 0
  • segments
    array of
    object
    required

    The agency's saved filters of travelers.

    • filter
      object
      required

      The conditions the segment's travelers meet.

      • assignedAdvisorUserId
        optional
        string

        Travelers this advisor serves, by user id. Left out, any advisor.

        minLength: 1
      • documentExpiringWithinDays
        optional
        integer

        Travelers with a document that expires within this many days, 1 to 730.

        maximum: 730 · minimum: 1
      • isArchived
        optional
        boolean

        True keeps archived travelers, false the ones not archived. Left out, the list's own isArchived decides: travelers not archived, unless it says otherwise.

      • nextTripWithinDays
        optional
        integer

        Travelers whose next trip starts within this many days, 1 to 365.

        maximum: 365 · minimum: 1
      • stage
        optional
        CLIENT
        or
        LEAD

        Travelers at this stage only.

      • tag
        optional
        string

        Travelers with this tag only.

        maxLength: 40 · minLength: 1
    • name
      string
      required

      The segment's name, 1 to 80 characters.

      maxLength: 80 · minLength: 1
    • segmentId
      string
      required

      The segment's id: what GET /crm/travelers?segmentId= takes.

      minLength: 1
  • taskTemplates
    array of
    object
    required

    The agency's task templates.

    • applyOnTripCreated
      boolean
      required

      Whether the template is applied to every trip of the agency as soon as the trip is created.

    • name
      string
      required

      The template's name, 1 to 80 characters.

      maxLength: 80 · minLength: 1
    • tasks
      array of
      object
      required

      The tasks the template adds to a trip, 1 to 30.

      • anchor
        TRIP_CREATED
        or
        TRIP_END
        or
        TRIP_START
        required

        The trip date the task's date counts from.

      • offsetDays
        integer
        required

        Days after the anchor, -365 to 365; negative is before it, 0 is the anchor's day.

        maximum: 365 · minimum: -365
      • title
        string
        required

        The title of the task the template adds, 1 to 255 characters.

        maxLength: 255 · minLength: 1
    • templateId
      string
      required

      The template's id: what POST /crm/task-templates/{templateId}/apply takes.

      minLength: 1
  • updatedAt
    required

    When the settings last changed; null until the first save.

    Any of the following:

    • string
    • null
  • webhooks
    array of
    object
    required

    The agency's webhooks. Only the answer to an update carries a secret, and only on the webhooks that update created.

    • createdAt
      string
      required

      When the webhook was added.

      format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
    • events
      array of
      string
      ·
      one of 14 values
      required

      The events sent to the webhook.

      Allowed values: crm.advisor-reminders-due.v1, crm.note-changed.v1, crm.settings-updated.v1, crm.task-changed.v1, crm.traveler-advisors-changed.v1, crm.traveler-created.v1, crm.traveler-documents-changed.v1, crm.traveler-erased.v1, crm.traveler-invitation-requested.v1, crm.traveler-linked.v1, crm.traveler-unlinked.v1, crm.traveler-updated.v1, crm.travelers-merged.v1, crm.trip-updated.v1
    • isActive
      boolean
      required

      Whether events are sent to it; false pauses it without losing it.

    • secretLast4
      string
      required

      The last four characters of the signing secret, to tell secrets apart.

    • url
      string
      required

      The HTTPS address the events are posted to.

      format: uri · maxLength: 2048
    • webhookId
      string
      required

      The webhook's id, sent back in an update to keep the webhook and its secret.

      minLength: 1
    • secret
      optional
      string

      The signing secret (whsec_…) the endpoint checks each delivery's X-Nicer-Signature with. Present only in the answer to the update that created the webhook, and never again: store it then.

400

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

401

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

403

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

Type to search…

↑↓ navigate↵ selectEsc close