v1 · OpenAPI 3.1Panel

API referansı İngilizcedir.

Applications

Update an application

PATCH/v1/applications/{app_id}

Changes the name, the redirect URLs, the country restriction or Google sign-in. Send only the fields you change; the others keep their value. redirect_urls and country_restriction replace the whole stored value, so send the complete list every time.

region cannot be changed. Sending the current region is accepted; any other value answers 422 region_immutable. Fields this endpoint does not know, such as sector and user_countries, are ignored.

Redirect URLs. Google sign-in sends users back only to a URL on this list, and the redirect_uri of GET /v1/oauth/google/start must match an entry character for character: scheme, host, port, path and query. There are no wildcards. Each URL uses https; http is allowed only for localhost, 127.0.0.1 and [::1], for local development. A URL has a host, no user name or password, no #, * or spaces, and at most 500 characters. An application has at most 20; duplicates are dropped.

The application's region is told about the change before it is saved. If the region cannot answer, nothing changes and the response is 503 region_unavailable.

A secret key can update only its own application; of the secret key roles, only admin has applications:write.

Gereken yetki
applications:write
Kimlik doğrulama
Secret key · Organization API key

Yol parametreleri

  • app_idstringzorunlu

    Örnek: app_seller

Gövde application/json

  • namestring

  • regionstring

    Optional. Must equal the application's region; any other value is 422 region_immutable.

    Değerler: EU TR

  • redirect_urlsstring (uri)[]

    Replaces the whole list. The exact URLs Google sign-in may send users back to. https, or http for localhost, 127.0.0.1 and [::1]; a host, no user name or password, no #, * or spaces, at most 500 characters each. Duplicates are dropped. With an empty list, Google sign-in cannot start.

  • country_restrictionobject

    Replaces the stored restriction. A missing mode means all, missing countries means [].

    2 alan
    • modestring

      Değerler: all only_listedVarsayılan: all

    • countriesstring[]

  • providersobject

    1 alan
    • googleobject

      1 alan
      • enabledbooleanzorunlu

        Turns Google sign-in on or off for this application. On by default.

Yanıtlar

  • 200OKApplication

    The updated application

    • idstring

      Örnek: app_seller

    • namestring

    • regionstring

      More regions will be added; clients must accept unknown values.

      Değerler: EU TR

    • multi_regionboolean

      Not available yet; planned.

      Varsayılan: false

    • blockstring

      East block planned; operated by a separate company. Every application is west today.

      Değerler: west eastVarsayılan: west

    • sectorstringboş olabilir

    • user_countriesstring[]

    • country_restrictionobject

      2 alan
      • modestring

        Değerler: all only_listed

      • countriesstring[]

    • redirect_urlsstring[]

      The exact URLs Google sign-in may send users back to. Empty until you set them with PATCH /applications/{app_id}.

    • providersobject

      Social sign-in providers. Google is the only one today.

      1 alan
      • googleobject

        2 alan
        • enabledboolean

          On unless turned off with PATCH /applications/{app_id}.

          Varsayılan: true

        • modestring

          platform: Fox Login's own Google app. Using your own Google app is planned.

          Değerler: platform

    • publishable_keystring

      Örnek: pk_live_tr_8f2c91a7b3d04e5f

    • created_atstring (date-time)

  • 400Bad RequestError

    invalid_redirect_url (the message names the URL and the rule it breaks), too_many_redirect_urls (more than 20), invalid_name (1-100 characters), invalid_country_restriction (mode must be all or only_listed), invalid_country (not an ISO 3166-1 alpha-2 code) or invalid_body.

    • errorobjectzorunlu

      5 alan
      • codestringzorunlu

        Stable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable

        Örnek: region_unavailable

      • messagestringzorunlu

        Plain English, for developers

      • regionstringboş olabilir

        Region that produced the error, if any

        Değerler: EU TR

      • retryablebooleanzorunlu

      • detailsobject

  • 401UnauthorizedError

    Missing or invalid key or token. The Management API answers missing_api_key (no Bearer token) or invalid_api_key (unknown or revoked secret key or organization API key).

    • errorobjectzorunlu

      5 alan
      • codestringzorunlu

        Stable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable

        Örnek: region_unavailable

      • messagestringzorunlu

        Plain English, for developers

      • regionstringboş olabilir

        Region that produced the error, if any

        Değerler: EU TR

      • retryablebooleanzorunlu

      • detailsobject

  • 403ForbiddenError

    missing_scope (the role or scopes of the key, or the dashboard role, lack the scope), secret_key_not_allowed (a secret key called an endpoint for the whole organization) or not_a_member (X-Fox-Tenant names a tenant the caller does not belong to).

    • errorobjectzorunlu

      5 alan
      • codestringzorunlu

        Stable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable

        Örnek: region_unavailable

      • messagestringzorunlu

        Plain English, for developers

      • regionstringboş olabilir

        Region that produced the error, if any

        Değerler: EU TR

      • retryablebooleanzorunlu

      • detailsobject

  • 404Not FoundError

    Not found

    • errorobjectzorunlu

      5 alan
      • codestringzorunlu

        Stable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable

        Örnek: region_unavailable

      • messagestringzorunlu

        Plain English, for developers

      • regionstringboş olabilir

        Region that produced the error, if any

        Değerler: EU TR

      • retryablebooleanzorunlu

      • detailsobject

  • 422Unprocessable ContentError

    region_immutable: region differs from the application's region.

    • errorobjectzorunlu

      5 alan
      • codestringzorunlu

        Stable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable

        Örnek: region_unavailable

      • messagestringzorunlu

        Plain English, for developers

      • regionstringboş olabilir

        Region that produced the error, if any

        Değerler: EU TR

      • retryablebooleanzorunlu

      • detailsobject

  • 503Service UnavailableError

    region_unavailable: the user's region cannot answer right now. Retry after Retry-After seconds.

    • errorobjectzorunlu

      5 alan
      • codestringzorunlu

        Stable machine code, e.g. email_exists, country_not_allowed, user_moved, method_not_available, region_unavailable

        Örnek: region_unavailable

      • messagestringzorunlu

        Plain English, for developers

      • regionstringboş olabilir

        Region that produced the error, if any

        Değerler: EU TR

      • retryablebooleanzorunlu

      • detailsobject