Blockstream Enterprise
ReferenceAPI ReferenceAuth

Authorize Auth

Authorize Auth.

Request

AuthAuthorizeRequest
interface AuthAuthorizeRequest {
  action: 'add'
  resource: '/account-management/authorize'
  details: {
    invite_string: string
    device_name: string
    password: string | undefined
    push_token: string | undefined
    device_signature_pubkey: string
    device_encryption_pubkey: string
  }
}

Prop

Type

Response

AuthAuthorizeResponse_success
interface AuthAuthorizeResponse_success {
  status: 'success'
  error_code?: '-1' | '-2' | '-3' | '-4' | '-5' | '-6' | '-7' | '-8' | '-9' | '-10' | '-11' | '-12' | '-13' | undefined
  message?: string | undefined
  details: {
    device: {
      device_uuid: string
      device_name: string
      user_id: string
      created_at: number
    }
    user_id: string
    server_ecdsa_pubkey: string
    server_rsa_pubkey: string
  }
  metadata: unknown
}

Prop

Type

AuthAuthorizeResponse_pending
interface AuthAuthorizeResponse_pending {
  status: 'pending'
  error_code?: '-1' | '-2' | '-3' | '-4' | '-5' | '-6' | '-7' | '-8' | '-9' | '-10' | '-11' | '-12' | '-13' | undefined
  message?: string | undefined
  details: {
    proposal_id: string
  }
}

Prop

Type

AuthAuthorizeResponse_failed | unauthorized | rejected
interface AuthAuthorizeResponse_failed | unauthorized | rejected {
  status: 'failed' | 'unauthorized' | 'rejected'
  error_code?: '-1' | '-2' | '-3' | '-4' | '-5' | '-6' | '-7' | '-8' | '-9' | '-10' | '-11' | '-12' | '-13' | undefined
  message?: string | undefined
}

Prop

Type

Example

Example
import { resourceSchema } from '@blockstream/ecs-js-sdk'
import { broadcastRequest } from './broadcaster'

const response = await broadcastRequest<
  typeof resourceSchema.shape.auth.shape.authorize
>(
  {
    action: 'add',
    resource: '/account-management/authorize',
    details: {
      // TODO: fill in required fields
    },
  },
  blockstream,
)

On this page