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

# Import cookies into a browser profile

> Add sign-in cookies to a browser profile. This is what `gumloop browser import-logins` calls. Send the cookies in Chrome extension (`chrome.cookies.Cookie`) or Chrome DevTools Protocol `Cookie` shape. With `url`, only that site's cookies are kept and the import replaces that site; without it, every site in the payload is imported. Cookies are encrypted with the profile's key before storage and are never returned by any endpoint.

Use `default` as the `profile_id` to import into the owner's default profile, creating it if needed.




## OpenAPI

````yaml post /browser-profiles/{profile_id}/cookies
openapi: 3.0.0
info:
  title: Public API
  version: 1.0.0
servers:
  - url: https://api.gumloop.com/api/v1
security: []
paths:
  /browser-profiles/{profile_id}/cookies:
    post:
      tags:
        - Browser profiles
      summary: Import cookies into a browser profile
      description: >
        Add sign-in cookies to a browser profile. This is what `gumloop browser
        import-logins` calls. Send the cookies in Chrome extension
        (`chrome.cookies.Cookie`) or Chrome DevTools Protocol `Cookie` shape.
        With `url`, only that site's cookies are kept and the import replaces
        that site; without it, every site in the payload is imported. Cookies
        are encrypted with the profile's key before storage and are never
        returned by any endpoint.


        Use `default` as the `profile_id` to import into the owner's default
        profile, creating it if needed.
      operationId: importBrowserProfileCookies
      parameters:
        - in: path
          name: profile_id
          required: true
          schema:
            type: string
          description: A profile id, or `default`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - cookies
              properties:
                url:
                  type: string
                  maxLength: 2048
                  description: >-
                    Import only the cookies for this site and replace what the
                    profile had for it. Omit to import every site in `cookies`.
                cookies:
                  type: array
                  minItems: 1
                  description: Cookies in `chrome.cookies.Cookie` or CDP `Cookie` shape.
                  items:
                    type: object
                    additionalProperties: true
                team_id:
                  type: string
                  description: Import into a team-owned profile instead of a personal one.
      responses:
        '200':
          description: Cookies imported.
          content:
            application/json:
              schema:
                type: object
                required:
                  - profile
                  - imported
                properties:
                  profile:
                    $ref: '#/components/schemas/BrowserProfile'
                  imported:
                    type: object
                    properties:
                      site:
                        type: string
                        nullable: true
                        description: The site imported when `url` was given.
                      cookie_count:
                        type: integer
                      skipped:
                        type: integer
                        description: >-
                          Cookies dropped because they were expired, malformed,
                          or outside `url`'s site.
                      sites:
                        type: array
                        items:
                          type: string
        '400':
          description: Invalid body, or no usable cookies.
        '401':
          description: Unauthorized — missing or invalid Gumloop API credentials.
        '403':
          description: Forbidden — the caller cannot manage variables in `team_id`.
        '404':
          description: Profile not found.
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >
            curl
            'https://api.gumloop.com/api/v1/browser-profiles/default/cookies' \
              -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
              -H 'Content-Type: application/json' \
              -d '{"url": "https://mail.google.com", "cookies": [{"name": "SID", "value": "...", "domain": ".google.com", "path": "/", "secure": true, "httpOnly": true, "expirationDate": 1790000000}]}'
        - lang: python
          label: Python
          source: >
            from gumloop import Gumloop


            client = Gumloop(access_token="YOUR_ACCESS_TOKEN")


            result = client.browser_profiles.import_cookies("default",
            url="https://mail.google.com", cookies=cookies)

            print(result.imported.site, result.imported.cookie_count)
components:
  schemas:
    BrowserProfile:
      type: object
      required:
        - profile_id
        - owner_id
        - owner_scope
        - name
      properties:
        profile_id:
          type: string
        owner_id:
          type: string
          description: The user or team that owns the profile.
        owner_scope:
          type: string
          enum:
            - personal
            - team
        name:
          type: string
        is_default:
          type: boolean
        version:
          type: integer
        sites:
          type: array
          items:
            type: object
            properties:
              domain:
                type: string
              cookie_count:
                type: integer
              updated_ts:
                type: string
                format: date-time
                nullable: true
        size_bytes:
          type: integer
          nullable: true
        has_storage:
          type: boolean
        created_by_user_id:
          type: string
          nullable: true
        created_ts:
          type: string
          format: date-time
          nullable: true
        updated_ts:
          type: string
          format: date-time
          nullable: true
        last_used_ts:
          type: string
          format: date-time
          nullable: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A personal API key or an [OAuth 2.0](/api-reference/oauth) access token.
        Personal API keys also require the `x-auth-key` header with your user
        ID.

````