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

# Get security headers

> <Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Returns the app's security header settings, and the framing policy the published app follows once its workspace's policy is applied.

Change `prevent_iframe_embedding` and `restrict_browser_features` with [Update security headers](/api-reference/update-security-headers). `effective_policy` is what the published app actually enforces, so read it rather than working the policy out from the other fields. When `app_allowlist_locked_by_workspace` is `true`, the workspace's policy decides who can frame the app.

This is limited to 60 requests per minute per app for each workspace's personal API keys, so every personal API key in a workspace shares one allowance, and each workspace API key has its own. Some workspaces have a different limit.

<Note>This endpoint accepts a personal API key belonging to a user with editor access to the app, including a read-only key. A workspace API key for the app's workspace also works, including a read-only one, and acts as the workspace owner.</Note>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json get /api/apps/{app_id}/security/headers
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - PersonalAccessTokenAuth: []
paths:
  /api/apps/{app_id}/security/headers:
    get:
      summary: Get security headers
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Returns the app's security header settings, and the framing policy the
        published app follows once its workspace's policy is applied.


        Change `prevent_iframe_embedding` and `restrict_browser_features` with
        [Update security headers](/api-reference/update-security-headers).
        `effective_policy` is what the published app actually enforces, so read
        it rather than working the policy out from the other fields. When
        `app_allowlist_locked_by_workspace` is `true`, the workspace's policy
        decides who can frame the app.


        This is limited to 60 requests per minute per app for each workspace's
        personal API keys, so every personal API key in a workspace shares one
        allowance, and each workspace API key has its own. Some workspaces have
        a different limit.


        <Note>This endpoint accepts a personal API key belonging to a user with
        editor access to the app, including a read-only key. A workspace API key
        for the app's workspace also works, including a read-only one, and acts
        as the workspace owner.</Note>
      operationId: get_security_headers_settings_api_apps__app_id__security_headers_get
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the app.
            title: App Id
          description: ID of the app.
          example: 6820f3a4e7b91d003c45a1f2
      responses:
        '200':
          description: The app's security header settings.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecurityHeadersSettingsResponse'
        '401':
          description: Missing or invalid credentials.
        '403':
          description: You don't have editor access to this app.
        '404':
          description: App not found.
        '429':
          description: >-
            Rate limit exceeded. The base limit is 60 requests per minute per
            app. Wait the number of seconds in the `Retry-After` header before
            you retry.
        '503':
          description: >-
            Database temporarily unavailable (`database_unavailable`): the data
            cluster did not answer in time. Retry after the `Retry-After`
            seconds.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
              examples:
                database_unavailable:
                  summary: database_unavailable
                  value:
                    error:
                      code: database_unavailable
                      message: Database temporarily unavailable, please retry
                      details: {}
      security:
        - PersonalAccessTokenAuth:
            - read_only
        - WorkspaceApiKeyAuth:
            - read_only
        - WorkspaceApiKeyBearerAuth:
            - read_only
components:
  schemas:
    SecurityHeadersSettingsResponse:
      properties:
        result:
          $ref: '#/components/schemas/SecurityHeadersSettingsResult'
          description: The app's security header settings.
      type: object
      required:
        - result
      title: SecurityHeadersSettingsResponse
    StandardErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/StandardError'
          description: What went wrong.
      type: object
      required:
        - error
      title: StandardErrorEnvelope
      description: The error body returned in the standard envelope.
    SecurityHeadersSettingsResult:
      properties:
        prevent_iframe_embedding:
          type: boolean
          title: Prevent Iframe Embedding
          description: >-
            Whether the app blocks every site from showing it in a frame. The
            value is `true` when the app blocks them, and the published app then
            sends `X-Frame-Options: DENY`. The value is `false` when the app
            doesn't.
          example: false
        restrict_browser_features:
          type: boolean
          title: Restrict Browser Features
          description: >-
            Whether the published app sends a restrictive `Permissions-Policy`
            header. The value is `true` when the app sends it and `false` when
            the app doesn't. The header lets only the app's own pages use the
            camera, microphone, location, payment, and USB features, and turns
            off the magnetometer and gyroscope.
          example: false
        embedding_origins:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Embedding Origins
          description: >-
            Sites the app itself allows to frame it, or `null` when the app has
            no list of its own.
          example:
            - https://partners.acme.com
        org_embedding_origins:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Org Embedding Origins
          description: >-
            Sites the app's workspace allows to frame its apps, or `null` when
            the workspace sets no list or its plan doesn't include one.
          example:
            - https://partners.acme.com
        org_prevent_iframe_embedding:
          type: boolean
          title: Org Prevent Iframe Embedding
          description: >-
            Whether the app's workspace blocks framing for all of its apps. The
            value is `true` when the workspace does and `false` when it doesn't.
          example: false
        app_policy:
          $ref: '#/components/schemas/AppEmbeddingPolicyResult'
          description: The framing policy set on the app itself.
        effective_policy:
          $ref: '#/components/schemas/EffectiveEmbeddingPolicyResult'
          description: >-
            The framing policy the published app actually sends, after the
            workspace policy is applied.
        app_allowlist_locked_by_workspace:
          type: boolean
          title: App Allowlist Locked By Workspace
          description: >-
            Whether the app's workspace controls which sites can frame its apps.
            The value is `true` when the workspace does, so the app can't set a
            list of its own, and `false` when it doesn't.
          example: false
      type: object
      required:
        - prevent_iframe_embedding
        - restrict_browser_features
        - embedding_origins
        - org_embedding_origins
        - org_prevent_iframe_embedding
        - app_policy
        - effective_policy
        - app_allowlist_locked_by_workspace
      title: SecurityHeadersSettingsResult
      description: Security header settings for one app.
    StandardError:
      properties:
        code:
          type: string
          title: Code
          description: >-
            Stable machine-readable cause of the failure. Match on this, not on
            `message`.
          example: not_found
        message:
          type: string
          title: Message
          description: Human-readable explanation. It isn't a stable contract.
          example: App not found
        details:
          additionalProperties: true
          type: object
          title: Details
          description: >-
            Structured context for the failure, or an empty object when there's
            none.
          example: {}
      type: object
      required:
        - code
        - message
      title: StandardError
    AppEmbeddingPolicyResult:
      properties:
        mode:
          type: string
          enum:
            - inherit
            - block_all
            - allowlist
          title: Mode
          description: |-
            What the app's own setting says.
            - `inherit`: The app sets no policy and follows its workspace.
            - `block_all`: No site can frame the app.
            - `allowlist`: Only the sites in `origins` can.
          example: allowlist
        origins:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Origins
          description: >-
            Sites allowed to frame the app when `mode` is `allowlist`, or `null`
            for the other modes.
          example:
            - https://partners.acme.com
      type: object
      required:
        - mode
        - origins
      title: AppEmbeddingPolicyResult
      description: An app's own framing policy.
    EffectiveEmbeddingPolicyResult:
      properties:
        mode:
          type: string
          enum:
            - anyone
            - block_all
            - allowlist
          title: Mode
          description: |-
            Who can show the published app in a frame.
            - `anyone`: Any site can.
            - `block_all`: No site can.
            - `allowlist`: Only the sites in `origins` can.
          example: allowlist
        source:
          type: string
          enum:
            - default
            - app
            - workspace
          title: Source
          description: |-
            Where the policy comes from.
            - `app`: The app's own setting.
            - `workspace`: The app's workspace policy.
            - `default`: Neither sets one.
          example: app
        origins:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Origins
          description: >-
            Sites allowed to frame the app when `mode` is `allowlist`, or `null`
            for the other modes.
          example:
            - https://partners.acme.com
      type: object
      required:
        - mode
        - source
        - origins
      title: EffectiveEmbeddingPolicyResult
      description: A published app's framing policy after its workspace policy is applied.
  securitySchemes:
    PersonalAccessTokenAuth:
      type: http
      scheme: bearer
      description: >-
        Personal access token, sent as `Authorization: Bearer <token>`. Each
        operation lists the permission it needs: `read_only` or `full_access`. A
        full-access token can call every operation. A read-only token can call
        only the operations that list `read_only`; anything else returns 403
        `read_only_credential_route_not_allowed`.
    WorkspaceApiKeyAuth:
      type: apiKey
      in: header
      name: api_key
      description: >-
        Workspace API key, sent as `api_key: <key>`. Each operation that accepts
        one lists what the key needs: a permission, `read_only` or
        `full_access`, like a personal access token, or a scope. A key without
        the scope gets 403 `workspace_api_key_scope_required`.
    WorkspaceApiKeyBearerAuth:
      type: http
      scheme: bearer
      description: >-
        Workspace API key, sent as `Authorization: Bearer <key>`. Accepted
        wherever `api_key` is, with the same permission.

````

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