Blockstream Enterprise
ReferenceAPI ReferenceGroups

Create Groups

Create Groups.

Request

GroupsCreateRequest
interface GroupsCreateRequest {
  action: 'add'
  resource: '/groups'
  details: {
    gid: string
    name: string
    description: string | undefined
  }
}

Prop

Type

Response

GroupsCreateResponse_success
interface GroupsCreateResponse_success {
  status: 'success'
  error_code?: '-1' | '-2' | '-3' | '-4' | '-5' | '-6' | '-7' | '-8' | '-9' | '-10' | '-11' | '-12' | '-13' | undefined
  message?: string | undefined
  details: {
    gid: string
    name: string
    description: string | undefined
    created_at: string
    created_by: string
    updated_at: string
    updated_by: string
    users: string[] | undefined
  }
  metadata: unknown
}

Prop

Type

GroupsCreateResponse_pending
interface GroupsCreateResponse_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

GroupsCreateResponse_failed | unauthorized | rejected
interface GroupsCreateResponse_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.groups.shape.create
>(
  {
    action: 'add',
    resource: '/groups',
    details: {
      // TODO: fill in required fields
    },
  },
  blockstream,
)

On this page