Authenticated person

GET /api/v4/me returns the authenticated person (person: any individual or legal entity registered in your tenant) that the API key belongs to, along with their tenant (the space in Fiscalapi that holds your issuers, recipients, credits, and data), the environment that serves the request, whether they're the owner (the person who created the tenant), what they can do, and their balances. Use it to validate a credential before you operate.

Authenticated person model

The authenticated person model describes the person the API key belongs to, with their permissions and balances. Get the authenticated person returns it.

Properties

  • Name
    id
    Type
    string?
    Description

    Unique identifier of the person.

  • Name
    legalName
    Type
    string?
    Description

    Legal name of the person.

  • Name
    tin
    Type
    string?
    Description

    The person's RFC (Mexico's taxpayer ID, Registro Federal de Contribuyentes).

  • Name
    email
    Type
    string?
    Description

    The person's email address.

  • Name
    tenantId
    Type
    string?
    Description

    Identifier of the tenant that the API key belongs to. It's the tenant you send in X-TENANT-KEY.

  • Name
    environment
    Type
    string?
    Description

    The environment that serves the request: Test or Production.

  • Name
    isOwner
    Type
    boolean?
    Description

    true if the person is the owner of the tenant, that is, the person who created it.

  • Name
    features
    Type
    object?
    Description

    The person's roles, granted and denied permissions, the tenant's features, the subscription, and seat assignments (seatAssignments).

  • Name
    balances
    Type
    array of objects?

    Balance by credit type. A credit type that doesn't appear in the list has a balance of 0.

  • Name
    creditType
    Type
    integer | number?
    expandable
    Description

    Credit type.

    Type
    enum:
    Values
    123
  • Name
    available
    Type
    integer | number?
    Description

    Available balance of that credit type.


GET/api/v4/me

Get the authenticated person

This endpoint takes no parameters. It always returns the person of the API key you send. It doesn't return secrets or other people's data.

Errors

The endpoint responds with the status in the table and the message in details of the response model.

StatusWhen it happensMessage
401The X-TENANT-KEY header is missing.Missing required http X-TENANT-KEY.
401The X-API-KEY header is missing.Missing required http X-API-KEY.
401The tenant doesn't exist.Invalid tenant key
401The API key isn't valid or belongs to another tenant.Invalid API KEY
401The person the API key belongs to is deactivated.Tu cuenta está desactivada. Escríbenos a soporte@fiscalapi.com.
403The tenant is deactivated.El tenant está desactivado. Escríbenos a soporte@fiscalapi.com.

Request

GET
/api/v4/me
curl --location 'https://test.fiscalapi.com/api/v4/me' \
--header 'X-TENANT-KEY: <tenant-key>' \
--header 'X-TIME-ZONE: America/Mexico_City' \
--header 'X-API-KEY: <api-key>'

Response

{
  "data": {
    "id": "78d380fd-1b69-4e3c-8bc0-4f57737f7d5f",
    "legalName": "KARLA FUENTE NOLASCO",
    "tin": "FUNK671228PH6",
    "email": "persona@example.com",
    "tenantId": "102e5f13-e114-41dd-bea7-507fce177281",
    "environment": "Test",
    "isOwner": true,
    "features": {
      "isOwner": true,
      "roles": [
        "Owner"
      ],
      "permissions": [
        "SatValidations.Read",
        "SatValidations.Run",
        "Invoices.Read",
        "Invoices.Issue",
        "Invoices.Cancel",
        "Invoices.Send",
        "Invoices.CheckStatus",
        "Invoices.Calculate",
        "Tickets.Read",
        "AutoInvoice.Read",
        "StripeApp.Read",
        "StripeApp.Manage",
        "Webhooks.Manage",
        "XmlDownloader.Read",
        "Billing.Read",
        "Billing.Purchase",
        "ApiKeys.Manage",
        "Reports.Manage",
        "Catalogs.Read",
        "Products.Manage",
        "TaxFiles.Manage",
        "People.Manage",
        "Kpis.Read",
        "Manifests.Manage",
        "TestAccounts.Reactivate",
        "Credits.Read",
        "Credits.Transfer",
        "Credits.TransferOnBehalf"
      ],
      "denied": {
        "Tickets.Create": {
          "missingFeatures": [
            "auto_cfdi"
          ]
        },
        "Tickets.Cancel": {
          "missingFeatures": [
            "auto_cfdi"
          ]
        },
        "AutoInvoice.Manage": {
          "missingFeatures": [
            "auto_cfdi"
          ]
        },
        "DownloadRules.Create": {
          "missingFeatures": [
            "descarga_cfdi"
          ]
        }
      },
      "features": {
        "emision_cfdi": {
          "values": {}
        }
      },
      "subscription": {
        "status": "active",
        "isAvailable": true
      },
      "seatAssignments": []
    },
    "balances": [
      {
        "creditType": 1,
        "available": 7
      },
      {
        "creditType": 2,
        "available": 3
      }
    ]
  },
  "succeeded": true,
  "message": "",
  "details": "",
  "httpStatusCode": 200
}

Was this page helpful?