Core API

Authentication

POST /auth/login

Authenticate a user and return an access token.

Request Body
{
  "email": "user@example.com",
  "secret": "your-password",
  "tfaCode": "123456"
}
POST /auth/initiate-login

Initiate a login flow for a given email address.

Request Body
{
  "email": "user@example.com"
}
POST /auth/logout

Terminate the current session.

Request Body
{}
POST /auth/refresh-token

Refresh the current access token.

Headers
x-refresh-token: <refreshToken>
Core API

User

POST /user/profile/organization

Return the current user profile in the selected organization context.

Optional Header
x-active-organization-id: <organizationId>
POST /user/change-password

Change the current user password.

Request Body
{
  "password": "new-password",
  "oldPassword": "current-password"
}
Core API

Two-Factor Authentication

POST/two-factor-auth/create

Create a two-factor authentication method for the current user.

{
  "password": "current-password",
  "type": "totp"
}
POST/two-factor-auth/activate

Activate a previously created two-factor authentication method.

{
  "tfaCode": "123456"
}
POST/two-factor-auth/disable

Disable a two-factor authentication method.

{
  "tfaId": "<tfaId>",
  "password": "current-password"
}
POST/two-factor-auth/remove

Remove a two-factor authentication method.

{
  "tfaId": "<tfaId>",
  "password": "current-password"
}
GET/two-factor-auth/list

List configured two-factor authentication methods for the current user.

Core API

Organizations & Profiles

GET/organization/list

List organizations available to the authenticated user.

POST/organization-profile/api-key/create

Create an API key for a given organization profile.

{
  "profileId": "<profileId>"
}
POST/organization-profile/api-key/list

List API keys for a given organization profile.

{
  "profileId": "<profileId>"
}
POST/organization-profile/flag/set

Set or remove feature flags on an organization profile.

{
  "profileId": "<profileId>",
  "flags": [
    {
      "flag": "GHGP",
      "value": true
    },
    {
      "flag": "BOOK_AND_CLAIM",
      "value": null
    }
  ]
}
Core API

Organization Users

POST/organization-user/list

List users associated with the current organization.

{}
POST/organization-user/invite-user

Invite a user to an organization.

{
  "organizationId": "<organizationId>",
  "email": "new.user@example.com",
  "firstName": "First",
  "lastName": "Last"
}
POST/organization-user/resend-user-invitation

Resend an invitation for an existing organization user.

{
  "organizationId": "<organizationId>",
  "userId": "<userId>"
}
POST/organization-user/set-organization-role

Assign organization-level roles to a user.

{
  "organizationId": "<organizationId>",
  "userId": "<userId>",
  "defaultRoleCodes": ["default.organization.admin"],
  "roleCodes": ["basic.admin"]
}
POST/organization-user/set-organization-profile-role

Assign organization-profile-level roles to a user.

{
  "profileId": "<profileId>",
  "userId": "<userId>",
  "roleCodes": ["basic.admin"]
}
Core API

Business Locations

POST/business-location/create

Create a business location associated with an organization profile.

{
  "profileId": "<profileId>",
  "name": "Location Name",
  "type": "buying",
  "basin": "Permian",
  "isDirectConnection": false,
  "preferredSuppliers": ["Antero"],
  "coordinates": {
    "latitude": 31.972096,
    "longitude": -83.760640
  },
  "address": {
    "country": "US"
  }
}
POST/business-location/update

Update a business location.

{
  "_id": "<businessLocationId>",
  "basin": "Permian",
  "isDirectConnection": true,
  "preferredSuppliers": ["QB"],
  "name": "Updated Location",
  "address": {
    "country": "US",
    "state": "NY"
  },
  "status": "active"
}
POST/business-location/details

Return details for a business location.

{
  "_id": "<businessLocationId>"
}
POST/business-location/list

List business locations for a given profile.

{
  "profileId": "<profileId>"
}
Administrative API

Internal and Administrative APIs

Administrative endpoints for internal user, organization, RBAC, preproduction, and report management workflows.

Internal User Management

POST/internal/user/create
{
  "email": "user@example.com",
  "firstName": "First",
  "lastName": "Last",
  "password": "temporary-password",
  "roleLinks": []
}
POST/internal/user/update
{
  "_id": "<userId>",
  "firstName": "UpdatedFirstName"
}
POST/internal/user/add-role-links
{
  "userId": "<userId>",
  "roleLinks": [
    {
      "roleCode": "default.organization.admin",
      "entityType": "organization",
      "entityId": "<organizationId>"
    },
    {
      "roleCode": "sox.producer.admin",
      "entityType": "organization_profile",
      "entityId": "<profileId>"
    }
  ]
}
POST/internal/user/remove-role-links
{
  "userId": "<userId>",
  "roleLinks": [
    {
      "roleCode": "default.organization.admin",
      "entityType": "organization",
      "entityId": "<organizationId>"
    }
  ]
}
POST/internal/user/set-password
{
  "userId": "<userId>",
  "password": "new-password"
}
POST/internal/user/reset-password
{
  "userId": "<userId>"
}
GET/internal/user/details/{userId}
POST/internal/user/list
{
  "email": "partial-or-full-email"
}

Internal Two-Factor Authentication

POST/internal/two-factor-auth/list
{
  "userId": "<userId>"
}
POST/internal/two-factor-auth/remove
{
  "userId": "<userId>",
  "tfaId": "<tfaId>"
}

Internal Organization Management

POST/internal/organization/create
{
  "name": "Organization Name",
  "taxId": "123456789",
  "duns": "123456789"
}
POST/internal/organization/update
{
  "_id": "<organizationId>",
  "name": "Updated Organization Name",
  "taxId": "",
  "status": "archive",
  "address": {}
}
POST/internal/organization/list
{}
GET/internal/organization/details/{organizationId}
client-id: <clientId>
client-key: <clientKey>

Internal Organization Profile Management

POST/internal/organization-profile/create
{
  "name": "Organization Profile Name",
  "organizationId": "<organizationId>",
  "taxId": "800162034",
  "duns": "831003012",
  "participantTypes": ["producer"],
  "participantTags": [
    {
      "tag": "nat_gas_producer"
    }
  ]
}
POST/internal/organization-profile/update
{
  "_id": "<profileId>",
  "participantTags": [
    {
      "tag": "nat_gas_producer",
      "measurers": [
        {"identifier": "mock-server", "standardTypes": ["OGCI", "NGSI"]},
        {"identifier": "project-canary", "standardTypes": ["OGCI"]}
      ],
      "verifiers": [
        {"identifier": "demo_verifier"},
        {"identifier": "spirit"}
      ]
    },
    {
      "tag": "nat_gas_transportation_producer"
    },
    {
      "tag": "nat_gas_buyer"
    },
    {
      "tag": "nat_gas_transportation_buyer"
    }
  ]
}
POST/internal/organization-profile/list
{
  "participantTags": [
    {"tag": "nat_gas_transportation_producer"}
  ]
}
GET/internal/organization-profile/details/{profileId}
client-id: <clientId>
client-key: <clientKey>

Internal Business Locations

POST/internal/business-location/create
{
  "profileId": "<profileId>",
  "name": "Location Name",
  "coordinates": {
    "latitude": 31.972096,
    "longitude": -83.760640
  },
  "address": {
    "country": "US"
  }
}
POST/internal/business-location/update
{
  "_id": "<businessLocationId>",
  "name": "Updated Name",
  "address": {
    "country": "US",
    "state": "NY"
  },
  "status": "active"
}
POST/internal/business-location/details
{
  "_id": "<businessLocationId>"
}
POST/internal/business-location/list
{
  "profileId": "<profileId>"
}

RBAC

GET/internal/RBAC/export
POST/internal/rbac/roles
{}
POST/internal/rbac/permissions
{}
POST/internal/rbac/remove-all-roles-and-permissions
{}

Preproduction Utilities

POST/internal/preprod/set-api-keys
POST/internal/preprod/set-passwords
{
  "password": "temporary-password"
}
POST/internal/preprod/remove-tfas

Report Utilities

GET/internal/report/ping
POST/internal/report/html
{
  "template": "retirement",
  "data": {}
}
POST/internal/report/pdf
{
  "template": "retirement1",
  "data": {}
}