Files
signal-cli-rest-api/src/docs/swagger.yaml
Bernhard B 3fcd6221d2 added new REST API endpoints
* added endpoint to add members to an existing group
* added endpoint to remove members from an existing group

see #210
2022-03-20 20:39:40 +01:00

1119 lines
26 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

basePath: /
definitions:
api.AddDeviceRequest:
properties:
uri:
type: string
type: object
api.ChangeGroupMembersRequest:
properties:
members:
items:
type: string
type: array
type: object
api.Configuration:
properties:
logging:
$ref: '#/definitions/api.LoggingConfiguration'
type: object
type: object
api.CreateGroupRequest:
properties:
description:
type: string
group_link:
enum:
- disabled
- enabled
- enabled-with-approval
type: string
members:
items:
type: string
type: array
name:
type: string
permissions:
$ref: '#/definitions/api.GroupPermissions'
type: object
type: object
api.CreateGroupResponse:
properties:
id:
type: string
type: object
api.Error:
properties:
error:
type: string
type: object
api.GroupPermissions:
properties:
add_members:
enum:
- only-admins
- every-member
type: string
edit_group:
enum:
- only-admins
- every-member
type: string
type: object
api.LoggingConfiguration:
properties:
Level:
type: string
type: object
api.Reaction:
properties:
reaction:
type: string
recipient:
type: string
target_author:
type: string
timestamp:
type: integer
type: object
api.RegisterNumberRequest:
properties:
captcha:
type: string
use_voice:
type: boolean
type: object
api.SearchResponse:
properties:
number:
type: string
registered:
type: boolean
type: object
api.SendMessageResponse:
properties:
timestamp:
type: string
type: object
api.SendMessageV1:
properties:
base64_attachment:
type: string
is_group:
type: boolean
message:
type: string
number:
type: string
recipients:
items:
type: string
type: array
type: object
api.SendMessageV2:
properties:
base64_attachments:
items:
type: string
type: array
message:
type: string
number:
type: string
recipients:
items:
type: string
type: array
type: object
api.TrustIdentityRequest:
properties:
verified_safety_number:
type: string
type: object
api.TypingIndicatorRequest:
properties:
recipient:
type: string
type: object
api.UnregisterNumberRequest:
properties:
delete_account:
example: false
type: boolean
type: object
api.UpdateContactRequest:
properties:
expiration_in_seconds:
type: integer
name:
type: string
recipient:
type: string
type: object
api.UpdateProfileRequest:
properties:
base64_avatar:
type: string
name:
type: string
type: object
api.VerifyNumberSettings:
properties:
pin:
type: string
type: object
client.About:
properties:
build:
type: integer
mode:
type: string
version:
type: string
versions:
items:
type: string
type: array
type: object
client.GroupEntry:
properties:
blocked:
type: boolean
id:
type: string
internal_id:
type: string
invite_link:
type: string
members:
items:
type: string
type: array
name:
type: string
pending_invites:
items:
type: string
type: array
pending_requests:
items:
type: string
type: array
type: object
client.IdentityEntry:
properties:
added:
type: string
fingerprint:
type: string
number:
type: string
safety_number:
type: string
status:
type: string
type: object
info:
contact: {}
description: This is the Signal Cli REST API documentation.
license: {}
title: Signal Cli REST API
version: "1.0"
paths:
/v1/about:
get:
description: Returns the supported API versions and the internal build nr
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/client.About'
summary: Lists general information about the API
tags:
- General
/v1/attachments:
get:
description: List all downloaded attachments
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
type: string
type: array
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: List all attachments.
tags:
- Attachments
/v1/attachments/{attachment}:
delete:
description: Remove the attachment with the given id from filesystem.
parameters:
- description: Attachment ID
in: path
name: attachment
required: true
type: string
produces:
- application/json
responses:
"204":
description: No Content
schema:
type: string
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Remove attachment.
tags:
- Attachments
get:
description: Serve the attachment with the given id
parameters:
- description: Attachment ID
in: path
name: attachment
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Serve Attachment.
tags:
- Attachments
/v1/configuration:
get:
consumes:
- application/json
description: List the REST API configuration.
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/api.Configuration'
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: List the REST API configuration.
tags:
- General
post:
consumes:
- application/json
description: Set the REST API configuration.
parameters:
- description: Configuration
in: body
name: data
required: true
schema:
$ref: '#/definitions/api.Configuration'
produces:
- application/json
responses:
"204":
description: OK
schema:
type: string
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Set the REST API configuration.
tags:
- General
/v1/contacts{number}:
put:
consumes:
- application/json
description: Updates the info associated to a number on the contact list.
parameters:
- description: Registered Phone Number
in: path
name: number
required: true
type: string
- description: Contact
in: body
name: data
required: true
schema:
$ref: '#/definitions/api.UpdateContactRequest'
produces:
- application/json
responses:
"204": {}
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Updates the info associated to a number on the contact list. If the contact doesnt exist yet, it will be added.
tags:
- Contacts
/v1/devices/{number}:
post:
consumes:
- application/json
description: Links another device to this device. Only works, if this is the master device.
parameters:
- description: Registered Phone Number
in: path
name: number
required: true
type: string
- description: Request
in: body
name: data
required: true
schema:
$ref: '#/definitions/api.AddDeviceRequest'
produces:
- application/json
responses:
"204": {}
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Links another device to this device.
tags:
- Devices
/v1/groups/{number}:
get:
consumes:
- application/json
description: List all Signal Groups.
parameters:
- description: Registered Phone Number
in: path
name: number
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/client.GroupEntry'
type: array
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: List all Signal Groups.
tags:
- Groups
post:
consumes:
- application/json
description: Create a new Signal Group with the specified members.
parameters:
- description: Input Data
in: body
name: data
required: true
schema:
$ref: '#/definitions/api.CreateGroupRequest'
- description: Registered Phone Number
in: path
name: number
required: true
type: string
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/api.CreateGroupResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Create a new Signal Group.
tags:
- Groups
/v1/groups/{number}/{groupid}:
delete:
consumes:
- application/json
description: Delete the specified Signal Group.
parameters:
- description: Registered Phone Number
in: path
name: number
required: true
type: string
- description: Group Id
in: path
name: groupid
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Delete a Signal Group.
tags:
- Groups
get:
consumes:
- application/json
description: List a specific Signal Group.
parameters:
- description: Registered Phone Number
in: path
name: number
required: true
type: string
- description: Group ID
in: path
name: groupid
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/client.GroupEntry'
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: List a Signal Group.
tags:
- Groups
/v1/groups/{number}/{groupid}/block:
post:
consumes:
- application/json
description: Block the specified Signal Group.
parameters:
- description: Registered Phone Number
in: path
name: number
required: true
type: string
- description: Group ID
in: path
name: groupid
required: true
type: string
produces:
- application/json
responses:
"204":
description: No Content
schema:
type: string
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Block a Signal Group.
tags:
- Groups
/v1/groups/{number}/{groupid}/join:
post:
consumes:
- application/json
description: Join the specified Signal Group.
parameters:
- description: Registered Phone Number
in: path
name: number
required: true
type: string
- description: Group ID
in: path
name: groupid
required: true
type: string
produces:
- application/json
responses:
"204":
description: No Content
schema:
type: string
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Join a Signal Group.
tags:
- Groups
/v1/groups/{number}/{groupid}/members:
delete:
consumes:
- application/json
description: Remove one or more members from an existing Signal Group.
parameters:
- description: Members
in: body
name: data
required: true
schema:
$ref: '#/definitions/api.ChangeGroupMembersRequest'
- description: Registered Phone Number
in: path
name: number
required: true
type: string
produces:
- application/json
responses:
"204":
description: No Content
schema:
type: string
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Remove one or more members from an existing Signal Group.
tags:
- Groups
post:
consumes:
- application/json
description: Add one or more members to an existing Signal Group.
parameters:
- description: Members
in: body
name: data
required: true
schema:
$ref: '#/definitions/api.ChangeGroupMembersRequest'
- description: Registered Phone Number
in: path
name: number
required: true
type: string
produces:
- application/json
responses:
"204":
description: No Content
schema:
type: string
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Add one or more members to an existing Signal Group.
tags:
- Groups
/v1/groups/{number}/{groupid}/quit:
post:
consumes:
- application/json
description: Quit the specified Signal Group.
parameters:
- description: Registered Phone Number
in: path
name: number
required: true
type: string
- description: Group ID
in: path
name: groupid
required: true
type: string
produces:
- application/json
responses:
"204":
description: No Content
schema:
type: string
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Quit a Signal Group.
tags:
- Groups
/v1/health:
get:
description: Internally used by the docker container to perform the health check.
produces:
- application/json
responses:
"204":
description: No Content
schema:
type: string
summary: API Health Check
tags:
- General
/v1/identities/{number}:
get:
description: List all identities for the given number.
parameters:
- description: Registered Phone Number
in: path
name: number
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/client.IdentityEntry'
type: array
summary: List Identities
tags:
- Identities
/v1/identities/{number}/trust/{numberToTrust}:
put:
description: Trust an identity.
parameters:
- description: Input Data
in: body
name: data
required: true
schema:
$ref: '#/definitions/api.TrustIdentityRequest'
- description: Registered Phone Number
in: path
name: number
required: true
type: string
- description: Number To Trust
in: path
name: numberToTrust
required: true
type: string
produces:
- application/json
responses:
"204":
description: No Content
schema:
type: string
summary: Trust Identity
tags:
- Identities
/v1/profiles/{number}:
put:
description: Set your name and optional an avatar.
parameters:
- description: Profile Data
in: body
name: data
required: true
schema:
$ref: '#/definitions/api.UpdateProfileRequest'
- description: Registered Phone Number
in: path
name: number
required: true
type: string
produces:
- application/json
responses:
"204":
description: No Content
schema:
type: string
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Update Profile.
tags:
- Profiles
/v1/qrcodelink:
get:
description: Link device and generate QR code
parameters:
- description: Device Name
in: query
name: device_name
required: true
type: string
produces:
- application/json
responses:
"200":
description: Image
schema:
type: string
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Link device and generate QR code.
tags:
- Devices
/v1/reactions/{number}:
delete:
consumes:
- application/json
description: Remove a reaction
parameters:
- description: Reaction
in: body
name: data
required: true
schema:
$ref: '#/definitions/api.Reaction'
produces:
- application/json
responses:
"204":
description: No Content
schema:
type: string
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Remove a reaction.
tags:
- Reactions
post:
consumes:
- application/json
description: React to a message
parameters:
- description: Reaction
in: body
name: data
required: true
schema:
$ref: '#/definitions/api.Reaction'
produces:
- application/json
responses:
"204":
description: No Content
schema:
type: string
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Send a reaction.
tags:
- Reactions
/v1/receive/{number}:
get:
consumes:
- application/json
description: Receives Signal Messages from the Signal Network. If you are running the docker container in normal/native mode, this is a GET endpoint. In json-rpc mode this is a websocket endpoint.
parameters:
- description: Registered Phone Number
in: path
name: number
required: true
type: string
- description: 'Receive timeout in seconds (default: 1)'
in: query
name: timeout
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
type: string
type: array
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Receive Signal Messages.
tags:
- Messages
/v1/register/{number}:
post:
consumes:
- application/json
description: Register a phone number with the signal network.
parameters:
- description: Registered Phone Number
in: path
name: number
required: true
type: string
- description: Additional Settings
in: body
name: data
schema:
$ref: '#/definitions/api.RegisterNumberRequest'
produces:
- application/json
responses:
"201": {}
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Register a phone number.
tags:
- Devices
/v1/register/{number}/verify/{token}:
post:
consumes:
- application/json
description: Verify a registered phone number with the signal network.
parameters:
- description: Registered Phone Number
in: path
name: number
required: true
type: string
- description: Additional Settings
in: body
name: data
schema:
$ref: '#/definitions/api.VerifyNumberSettings'
- description: Verification Code
in: path
name: token
required: true
type: string
produces:
- application/json
responses:
"201":
description: OK
schema:
type: string
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Verify a registered phone number.
tags:
- Devices
/v1/search:
get:
consumes:
- application/json
description: Check if one or more phone numbers are registered with the Signal Service.
parameters:
- collectionFormat: multi
description: Numbers to check
in: query
items:
type: string
name: numbers
required: true
type: array
produces:
- application/json
responses:
"200":
description: OK
schema:
items:
$ref: '#/definitions/api.SearchResponse'
type: array
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Check if one or more phone numbers are registered with the Signal Service.
tags:
- Search
/v1/send:
post:
consumes:
- application/json
deprecated: true
description: Send a signal message
parameters:
- description: Input Data
in: body
name: data
required: true
schema:
$ref: '#/definitions/api.SendMessageV1'
produces:
- application/json
responses:
"201":
description: OK
schema:
type: string
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Send a signal message.
tags:
- Messages
/v1/typing-indicator/{number}:
delete:
consumes:
- application/json
description: Hide Typing Indicator.
parameters:
- description: Registered Phone Number
in: path
name: number
required: true
type: string
- description: Type
in: body
name: data
required: true
schema:
$ref: '#/definitions/api.TypingIndicatorRequest'
produces:
- application/json
responses:
"204":
description: No Content
schema:
type: string
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Hide Typing Indicator.
tags:
- Messages
put:
consumes:
- application/json
description: Show Typing Indicator.
parameters:
- description: Registered Phone Number
in: path
name: number
required: true
type: string
- description: Type
in: body
name: data
required: true
schema:
$ref: '#/definitions/api.TypingIndicatorRequest'
produces:
- application/json
responses:
"204":
description: No Content
schema:
type: string
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Show Typing Indicator.
tags:
- Messages
/v1/unregister/{number}:
post:
consumes:
- application/json
description: Disables push support for this device. **WARNING:** If *delete_account* is set to *true*, the account will be deleted from the Signal Server. This cannot be undone without loss.
parameters:
- description: Registered Phone Number
in: path
name: number
required: true
type: string
- description: Additional Settings
in: body
name: data
schema:
$ref: '#/definitions/api.UnregisterNumberRequest'
produces:
- application/json
responses:
"204": {}
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Unregister a phone number.
tags:
- Devices
/v2/send:
post:
consumes:
- application/json
description: Send a signal message
parameters:
- description: Input Data
in: body
name: data
required: true
schema:
$ref: '#/definitions/api.SendMessageV2'
produces:
- application/json
responses:
"201":
description: Created
schema:
$ref: '#/definitions/api.SendMessageResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Send a signal message.
tags:
- Messages
swagger: "2.0"
tags:
- description: Some general endpoints.
name: General
- description: Register and link Devices.
name: Devices
- description: Create, List and Delete Signal Groups.
name: Groups
- description: Send and Receive Signal Messages.
name: Messages
- description: List and Delete Attachments.
name: Attachments
- description: Update Profile.
name: Profiles
- description: List and Trust Identities.
name: Identities
- description: React to messages.
name: Reactions
- description: Search the Signal Service.
name: Search