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

# Create a saved contact



## OpenAPI

````yaml /openapi/escrybe.en.yaml post /api/v2/favorites
openapi: 3.1.0
info:
  title: Escrybe API
  version: 1.0.0
  description: >
    REST API for the Escrybe platform — send physical letters, registered
    letters, telegrams and e-Carta through Brazilian Correios, dispatch legally
    registered e-mails, and send WhatsApp messages with certified timestamps.


    ## Authentication

    Every account has a personal **`securityToken`** (find it in the panel under
    *Account → API*). Three products use it differently:


    | Product | Scheme | How | |---------|--------|-----| | Letters / Telegram /
    e-Carta, Registered E-mail, Receipts | API token | Send `userSecurityToken`
    as a query/body parameter, or `securityToken` as a header | | WhatsApp |
    HTTP Basic | `Authorization: Basic base64(email:securityToken)` |


    > The letter and e-mail **read** routes (`get`, `balance`, `download`, >
    `delete`) take the token as the first URL **path** segment — e.g. >
    `/api/v2/get/{securityToken}/{job_id}`.


    ## Response envelopes

    Most endpoints reply with the standard envelope `{"status": <http code>,
    "status_message": "...", "data": ...}` — this covers Letters/Telegram,
    Registered E-mail, and the WhatsApp message and sender endpoints. The
    WhatsApp **template** endpoints (and template sync) use `{"code": <http
    code>, "status": "success|error", "message": "...", "data": ...,
    "request_id": "..."}`; the logo endpoint uses the same shape without
    `request_id`. See the schema of each endpoint.


    A request that is accepted returns an HTTP `200` with a success payload;
    validation problems return `400`, bad credentials `401`, and forbidden
    access `403`. Unsupported HTTP methods return `405`, repeated failed
    authentication attempts return `429`, and the letter and e-mail endpoints
    return `503` during maintenance windows.
  contact:
    name: Escrybe Support
    url: https://escrybe.com.br
servers:
  - url: https://app.escrybe.com.br
    description: Production
  - url: https://homolog.escrybe.com.br
    description: Staging
security:
  - securityTokenQuery: []
tags:
  - name: Letters & Telegram
    description: Create and manage letter, telegram and e-Carta orders (Correios).
  - name: Account & Favorites
    description: Account balance, saved contacts and sender logo.
  - name: Registered E-mail
    description: Send and track legally registered e-mails.
  - name: WhatsApp Messages
    description: Send WhatsApp messages and download certified-timestamp attestations.
  - name: WhatsApp Senders
    description: Manage WhatsApp Business numbers (senders).
  - name: WhatsApp Templates
    description: Create, sync and manage WhatsApp message templates.
  - name: Receipts
    description: Download legal receipts for any order.
paths:
  /api/v2/favorites:
    post:
      tags:
        - Account & Favorites
      summary: Create a saved contact
      operationId: createFavorite
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FavoriteInput'
      responses:
        '200':
          description: Favorite created
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  favorite:
                    $ref: '#/components/schemas/Favorite'
        '400':
          $ref: '#/components/responses/FavoritesBadRequest'
        '401':
          $ref: '#/components/responses/FavoritesUnauthorized'
components:
  schemas:
    FavoriteInput:
      type: object
      required:
        - name
      properties:
        name:
          type: string
        label:
          type: string
        email:
          type: string
        phone:
          type: string
        document:
          type: string
        addr1:
          type: string
        street_number:
          type: string
        addr2:
          type: string
        zip:
          type: string
        city:
          type: string
        state:
          type: string
        country:
          type: string
          default: Brasil
        list_letter:
          type: boolean
          description: When none of the list_* flags is set, all three default to true.
        list_email:
          type: boolean
        list_whatsapp:
          type: boolean
    Favorite:
      type: object
      properties:
        id:
          type: integer
        id_user:
          type: integer
        label:
          type: string
          nullable: true
        name:
          type: string
        email:
          type: string
          nullable: true
        phone:
          type: string
          nullable: true
        document:
          type: string
          nullable: true
        addr1:
          type: string
          nullable: true
        street_number:
          type: string
          nullable: true
        addr2:
          type: string
          nullable: true
        zip:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        state:
          type: string
          nullable: true
        country:
          type: string
        list_letter:
          type: integer
        list_email:
          type: integer
        list_whatsapp:
          type: integer
        dateCreated:
          type: string
  responses:
    FavoritesBadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
              message:
                type: string
    FavoritesUnauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
              message:
                type: string
          example:
            success: false
            message: Não autorizado
  securitySchemes:
    securityTokenQuery:
      type: apiKey
      in: query
      name: userSecurityToken
      description: >-
        Your account security token, sent as the `userSecurityToken` query or
        form parameter.

````