> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lonescale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Brief many contacts

> Writes the outreach brief of **many people** in one run: up to 100 `contacts`, or the contacts of a HubSpot list (segment) given as `hubspot_list_id`, 100 at a time (pass the returned `next_after` as `after` to run the next page).

Answers at once with the run `id`. The briefs are written in the background, a few at a time, about a minute each. Read the run on `GET /brief/runs/{id}`.

`language`, `focus` and `custom_details` apply to every contact that does not set its own.

When an admin picked the fields for it (Chrome extension settings), each email draft is written to its CRM record, where a CRM workflow or a sequence can start from it.

Requires the AI assistant to be enabled for the API key's holder. No credits are charged. Rate limited to **5 requests per minute**.



## OpenAPI

````yaml POST /brief/bulk
openapi: 3.1.0
info:
  title: OpenAPI Lonescale
  description: A sample API for Lonescale
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://public-api.lonescale.com
security:
  - ApiKeyAuth: []
paths:
  /brief/bulk:
    post:
      description: >-
        Writes the outreach brief of **many people** in one run: up to 100
        `contacts`, or the contacts of a HubSpot list (segment) given as
        `hubspot_list_id`, 100 at a time (pass the returned `next_after` as
        `after` to run the next page).


        Answers at once with the run `id`. The briefs are written in the
        background, a few at a time, about a minute each. Read the run on `GET
        /brief/runs/{id}`.


        `language`, `focus` and `custom_details` apply to every contact that
        does not set its own.


        When an admin picked the fields for it (Chrome extension settings), each
        email draft is written to its CRM record, where a CRM workflow or a
        sequence can start from it.


        Requires the AI assistant to be enabled for the API key's holder. No
        credits are charged. Rate limited to **5 requests per minute**.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                contacts:
                  type: array
                  minItems: 1
                  maxItems: 100
                  description: >-
                    The people to brief. Required unless `hubspot_list_id` is
                    given.
                  items:
                    $ref: '#/components/schemas/BriefContact'
                hubspot_list_id:
                  type: string
                  description: 'A HubSpot list (segment) id: its contacts are briefed.'
                  example: '7793'
                limit:
                  type: integer
                  minimum: 1
                  maximum: 100
                  description: >-
                    HubSpot list only: how many contacts of the list. Default
                    100.
                after:
                  type: string
                  description: >-
                    HubSpot list only: the `next_after` a previous call
                    returned.
                crm:
                  type: string
                  enum:
                    - hubspot
                    - salesforce
                  description: >-
                    The CRM to read. Default: the one picked in the Chrome
                    extension settings, else the connected one. With no CRM
                    connected, the brief is written from the data you send.
                language:
                  type: string
                  enum:
                    - fr
                    - en
                  description: >-
                    Language of the drafts. Default: the language of the
                    account's country, else English.
                focus:
                  type: string
                  maxLength: 300
                  description: What the message should hook on, in a few words.
                custom_details:
                  type: string
                  maxLength: 4000
                  description: >-
                    Anything your team knows about this prospect or this
                    outreach: notes, an angle, an offer, facts from another
                    tool. Used for the messaging.
                  example: Met at Money20/20. Asked about multi-entity consolidation.
            examples:
              contacts:
                summary: A list of contacts
                value:
                  contacts:
                    - crm_contact_id: '710432049398'
                    - linkedin_url: https://www.linkedin.com/in/john-roe
                      company_name: Globex
                  custom_details: Q4 campaign on month-end close.
              hubspot_list:
                summary: A HubSpot list
                value:
                  hubspot_list_id: '7793'
                  limit: 100
      responses:
        '202':
          description: The run was queued
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BriefRunStarted'
              example:
                id: 9d2f6a54-1c1e-4f6b-8f0e-5a7c2b9e4d11
                status: running
                total: 2
                crm: hubspot
        '400':
          description: >-
            No contact, more than 100, a contact that names nobody, or a HubSpot
            list that cannot be read
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: At most 100 contacts per request
                error: Bad Request
                statusCode: 400
        '401':
          description: Invalid or missing authentication credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthError'
              example:
                message: Invalid API Key
                error: Unauthorized
                statusCode: 401
        '403':
          description: The AI assistant is not enabled for the API key's holder
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: AI assistant is not enabled for this member
                error: Forbidden
                statusCode: 403
        '404':
          description: The HubSpot list does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                message: HubSpot list not found
                error: Not Found
                statusCode: 404
components:
  schemas:
    BriefContact:
      type: object
      description: >-
        Who the brief is about. The CRM record id is the best input. Otherwise
        give the person's name with their current job title or company, and
        their LinkedIn URL or email when known: a person your CRM does not know
        still gets a brief, written from the fields given here and the profile
        LoneScale holds. A LinkedIn URL alone is enough only when LoneScale
        holds that profile. A brief with nothing to stand on (no CRM record, no
        profile, no role, no company, no `custom_details`) is refused with what
        to add.
      properties:
        crm_contact_id:
          type: string
          description: >-
            The CRM record of the person: a HubSpot contact id, or a Salesforce
            Contact or Lead id. **The best input**: the brief reads the record,
            its account and their history, and the LinkedIn profile LoneScale
            holds for the URL on the record. An id the CRM does not know is
            refused.
          example: '710432049398'
        email:
          type: string
          description: >-
            The person's email. Used to find them in the CRM when no
            `crm_contact_id` is given.
          example: jane.doe@acme.com
        linkedin_url:
          type: string
          description: >-
            The person's LinkedIn profile URL. Used to find them in the CRM, and
            to read the profile LoneScale holds for them.
          example: https://www.linkedin.com/in/jane-doe
        full_name:
          type: string
          example: Jane Doe
        job_title:
          type: string
          description: >-
            Their current job title, as their LinkedIn profile shows it. With
            `crm_contact_id`, leave it out: the record is read, and a CRM title
            is often old.
          example: Chief Financial Officer
        company_name:
          type: string
          example: Acme
        company_domain:
          type: string
          example: acme.com
        company_linkedin_url:
          type: string
        crm_company_id:
          type: string
          description: >-
            The CRM account, when you already know it: read by id instead of
            searched by domain or name.
        country:
          type: string
          description: >-
            The account's country (name or ISO code). Picks the drafts' language
            when `language` is not set.
        profile:
          type: object
          description: >-
            The person's profile, field by field. Every key is optional; unknown
            keys are ignored.
          properties:
            headline:
              type: string
            location:
              type: string
            about:
              type: string
            positions:
              type: array
              description: Current first.
              items:
                type: object
                properties:
                  title:
                    type: string
                  company:
                    type: string
                  dates:
                    type: string
                    example: 2023-03 - present
                  location:
                    type: string
                  description:
                    type: string
            education:
              type: array
              items:
                type: object
                properties:
                  school:
                    type: string
                  degree:
                    type: string
                  dates:
                    type: string
            skills:
              type: array
              items:
                type: string
            certifications:
              type: array
              items:
                type: string
            languages:
              type: array
              items:
                type: string
            recent_posts:
              type: array
              description: What the person posted lately, newest first.
              items:
                type: object
                properties:
                  text:
                    type: string
                  date:
                    type: string
            company:
              type: object
              properties:
                name:
                  type: string
                domain:
                  type: string
                linkedin_url:
                  type: string
                industry:
                  type: string
                size:
                  type: string
                location:
                  type: string
                description:
                  type: string
        profile_text:
          type: string
          maxLength: 20000
          description: The profile as plain text, when you do not have it field by field.
        past_experiences:
          type: array
          maxItems: 10
          description: >-
            Previous positions, most recent first. Each one is checked in the
            CRM (a past employer that is a customer is a strong opener). When
            omitted, LoneScale uses the profile it holds for `linkedin_url`.
          items:
            type: object
            required:
              - company_name
            properties:
              company_name:
                type: string
              company_linkedin_url:
                type: string
              title:
                type: string
              start:
                type: string
                description: '`YYYY` or `YYYY-MM`.'
              end:
                type: string
                description: '`YYYY` or `YYYY-MM`.'
        custom_details:
          type: string
          maxLength: 4000
          description: >-
            Anything your team knows about this prospect or this outreach:
            notes, an angle, an offer, facts from another tool. Used for the
            messaging.
          example: Met at Money20/20. Asked about multi-entity consolidation.
        focus:
          type: string
          maxLength: 300
          description: What the message should hook on, in a few words.
        language:
          type: string
          enum:
            - fr
            - en
          description: >-
            Language of the drafts. Default: the language of the account's
            country, else English.
    BriefRunStarted:
      type: object
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - running
            - done
        total:
          type: integer
          description: The number of contacts queued.
        crm:
          type: string
          nullable: true
          enum:
            - hubspot
            - salesforce
            - null
        next_after:
          type: string
          nullable: true
          description: >-
            HubSpot list only: the cursor of the next page, `null` at the end of
            the list.
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
    AuthError:
      required:
        - message
        - error
        - statusCode
      type: object
      properties:
        message:
          type: string
          example: Invalid API Key
        error:
          type: string
          example: Unauthorized
        statusCode:
          type: integer
          example: 401
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Provide your API key in the x-api-key header.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.