Nyhet: Telink AI Receptionist – Svara på samtal dygnet runtLäs mer
    Telink

    API Documentation

    Teknisk dokumentation för Telinks webhook-API:er. Välj ett API nedan för att komma igång.

    Overview

    With the Telink webhook it is possible for an external provider to create an independent middleware between Telink and any kind of CRM system(s). The middleware must handle the request and response formats described below.

    GET

    Number Lookup

    Automatic caller identification for incoming calls, number searches, and call log items.

    GET

    Custom ID Lookup

    Look up callers by a custom numeric ID entered via an Input Collector.

    POST

    Call Logging

    Automatic logging of call data to your CRM when call log items are created.

    When the middleware is up and running, contact Customer Care to add the request endpoint URLs to the customer's Insights settings.

    How it works

    Number Lookup

    Telink calls the lookup endpoint when:

    • The customer receives an incoming call
    • A number search is made (contact search or dialer)
    • Presenting items in a call log

    Number Lookup Flow

    Telink calls the lookup endpoint when:

    • The customer receives an incoming call
    • A number search is made (contact search or dialer)
    • Presenting items in a call log
    Number Lookup flow diagram
    Flow of events when a customer receives a call and the webhook for number lookup is called.

    Custom ID Lookup

    The custom ID endpoint is called when:

    • A caller enters a numeric ID via an Input Collector in an Answer Group
    • Displaying a related call log item (incl. dashboards)

    If the request returns a match, Telink presents "Caller Insights" accessible from the dialer, call log items, or contact pages.

    Caller Insights panel
    Example: Caller Insights showing contact data received via a webhook integration.

    Automatic Call Logging

    When enabled, the call logging endpoint is called each time a call ends and a call log item is created. The middleware syncs this with the CRM. Customers can configure which call types trigger requests (v2).

    Automatic Call Logging flow diagram
    Flow of events for automatic call logging when a call is terminated.

    Webhook Setup

    Any customer with the Insights add-on can have a webhook integration. The setup requires Superadmin permission and is handled by Customer Care.

    Webhook settings
    Webhook configuration in Organisation Settings.
    Webhook settings admin view
    Superadmin view with endpoints configured.

    Webhook integrations can be prioritized alongside other Insights integrations:

    Priority sorting of integrations
    Priority ordering for number lookup integrations.

    Details & Limitations

    • Lookup data is cached for 2 hours
    • Webhook request timeout: 3 seconds
    • Response times depend on the middleware implementation

    Implementation Notes

    Adding is not breaking! New fields may be added to JSON models over time. Integrators must ensure their integrations ignore unknown fields.

    If a middleware serves multiple customers, include a unique customer ID in the endpoint URL:

    bash
    https://middleware.provider.com/unique-customer-id

    Number & Custom ID Lookup

    GETRequest

    A HTTP GET request with authorization header (v2). Query parameters:

    FieldTypeDescription
    fromNumberstringThe caller's phone number
    toNumberstringThe dialed number (when applicable)
    customIdentifierstringFormat: customId:customValue (when custom ID is enabled)
    javascript
    app.get('/middleware/lookup', async (req, res) => {
      const { authorization } = req.headers;
      if (authorization !== 'Bearer YOUR_SECRET_HERE') {
        return res.status(403).json({ message: 'Invalid secret' });
      }
    
      const { fromNumber, toNumber, customIdentifier } = req.query;
    
      // Parse custom ID if provided
      const [customId, customValue] = customIdentifier?.split(':') || [];
    
      const result = await queryForContact(fromNumber, toNumber, customId, customValue);
      return res.status(200).json(result);
    });
    An optional user object is included if "Send user info" is enabled (experimental, requires Superadmin).

    User Object (Experimental)

    FieldTypeDescription
    firstNamestringFirst name of the user
    lastNamestringLast name of the user
    displayNamestringDisplay name of the user
    userIdsUserId[]Login IDs and types
    idstringUnique identifier

    UserId Object

    FieldTypeDescription
    typestring'email' or 'mobilePhone'
    usernamestringID used for user login

    Response

    Return a JSON object with the following fields:

    FieldTypeDescription
    displayNamestringContact's display name
    firstNamestringFirst name
    lastNamestringLast name
    avatarUrlstringCustom avatar image URL
    coverPhotoUrlstringCustom cover photo
    emailsEmail[]Contact's email addresses
    phoneNumbersPhoneNumber[]Contact's phone numbers
    companyInfoObjectCompany information
    fieldsField[]Additional contact fields
    activitiesActivity[]Note, Task, Call, Ticket, Deal, Appointment
    createActivityUrlsCreateUrl[]Shortcut URLs for creating activities
    moreInfoUrlstringURL to contact in external CRM
    acceptActionstringURL opened on call accept
    json
    {
      "displayName": "Jane Doe",
      "firstName": "Jane",
      "lastName": "Doe",
      "emails": [{ "id": "jane@company.com", "comment": "Work" }],
      "phoneNumbers": [{ "id": "+46701234567", "comment": "Mobile" }],
      "companyInfo": { "name": "ACME Corp", "title": "CTO" },
      "fields": [{ "comment": "Customer since", "title": "2023" }],
      "moreInfoUrl": "https://crm.example.com/contacts/123"
    }
    Response example in UI
    How the response data is rendered in the Insights panel.

    Response Sub-Types

    Email

    FieldTypeDescription
    idstringThe email address
    commentstringe.g. Work / Personal

    PhoneNumber

    FieldTypeDescription
    idstringThe phone number
    commentstringe.g. Work / Personal

    CompanyInfo

    FieldTypeDescription
    namestringCompany name
    titlestringContact's title at company

    Field

    FieldTypeDescription
    commentstringLabel text
    titlestringValue text

    Activities

    Up to 10 activities per type. Sorted by timestamp, newest first. Set markdown: true to enable markdown rendering in body fields.

    NoteNOTE

    FieldTypeDescription
    typestringNOTE
    bodystringNote body text
    timestampnumberUnix timestamp (ms)
    headerstringAppended: Note - "header"
    customHeaderstringOverride entire header
    associatedUserstringEmail
    linkstringURL – header as link
    markdownbooleanParse body as markdown

    TaskTASK

    FieldTypeDescription
    typestringTASK
    bodystringTask body text
    timestampnumberUnix timestamp (ms)
    dueDatenumberUnix timestamp (ms)
    headerstringAppended: Task - "header"
    customHeaderstringOverride header
    statusstringStatus text (hidden if done)
    donebooleanGreen checkmark
    assignedUserstringEmail
    linkstringURL – header as link
    markdownbooleanParse body as markdown

    CallCALL

    FieldTypeDescription
    typestringCALL
    bodystringCall body text
    timestampnumberUnix timestamp (ms)
    toNumberstringCallee
    fromNumberstringCaller
    durationnumberDuration (ms)
    startTimenumberUnix timestamp (ms)
    customHeaderstringOverride header
    linkstringURL – header as link
    markdownbooleanParse body as markdown

    TicketTICKET

    FieldTypeDescription
    typestringTICKET
    bodystringTicket body text
    timestampnumberUnix timestamp (ms)
    createdDatenumberUnix timestamp (ms)
    prioritystringHIGH, MEDIUM, or LOW
    headerstringAppended to default header
    customHeaderstringOverride header
    pipelinestringPipeline header
    pipelineStagestringPipeline stage text
    linkstringURL – header as link
    markdownbooleanParse body as markdown

    DealDEAL

    FieldTypeDescription
    typestringDEAL
    bodystringDeal body text
    timestampnumberUnix timestamp (ms)
    closeDatenumberUnix timestamp (ms)
    currencystringCurrency string
    amountnumberDeal value
    donebooleanCheckmark
    pipelinestringPipeline header
    pipelineStagestringPipeline stage text
    linkstringURL – header as link
    markdownbooleanParse body as markdown

    AppointmentAPPOINTMENT

    FieldTypeDescription
    typestringAPPOINTMENT
    timestampnumberUnix timestamp (ms)
    startDatenumberStart time (ms)
    endDatenumberEnd time (ms)
    allDaybooleanFull-day appointment
    bodystringBody text
    venuestringLocation
    headerstringHeader text
    statusstringStatus text
    linkstringURL – header as link
    markdownbooleanParse body as markdown

    createActivityUrl

    Shortcut to create an activity of the specified type for the looked-up contact.

    FieldTypeDescription
    namestringButton label
    urlstringTarget URL
    json
    {
      "type": "NOTE",
      "body": "**Important:** Follow up next week",
      "timestamp": 1709294400000,
      "markdown": true
    }

    Automatic Call Logging

    When enabled, Telink sends a HTTP POST with Content-Type: application/json for each call log item created.

    POSTRequest Body

    FieldTypeDescription
    fromNumberstringThe caller's number
    toNumberstringThe dialed number
    durationnumberCall length (ms)
    startTimenumberUnix timestamp (ms)
    callTypestringInbound | Outbound
    bodystringCall details text
    userIdstringUser's unique ID (v2)
    json
    {
      "fromNumber": "+46701234567",
      "toNumber": "+46812345678",
      "duration": 185000,
      "startTime": 1709294400000,
      "callType": "Inbound",
      "body": "Call from: +46701234567\nCall type: Inbound",
      "userId": "user-abc-123"
    }

    Body Format Conditions

    FormatCondition
    referred to: {phoneNumber}Participant transferred the call
    referred by: {phoneNumber}Caller was transferred by someone
    Call to user: {username} ({phoneNumber})CRM user → Telink user
    Call from user: {username} ({phoneNumber})Telink user → CRM user
    Call to answer group: {agName} ({phoneNumber})CRM user → answer group
    Telink agent: {username}Agent name for AG calls
    Call type: {callType}Always present
    Summary (appended)Recording + CI enabled (v2)

    Behöver du hjälp?

    Kontakta oss för att komma igång med din webhook-integration.

    Kontakta oss