Scrive Documents API

The Documents API from Scrive — 13 operation(s) for documents.

OpenAPI Specification

scrive-documents-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Scrive Document Access Control Documents API
  version: 2.0.0
  description: The Scrive Document API (eSign Online, Version 2) is a RESTful, JSON-over-HTTPS interface that creates, prepares, sends, and manages the full lifecycle of documents for electronic signing, with identity verification through Nordic and European e-ID methods (BankID, MitID, Freja, Smart-ID, and more). Document status changes are delivered to consumers via HTTP callback (webhook) URLs. Endpoints are grounded in the public documentation at https://apidocs.scrive.com/. Request and response schemas are modeled and should be verified against the live docs.
  contact:
    name: API Evangelist
    email: kin@apievangelist.com
  license:
    name: Proprietary
    url: https://www.scrive.com/
servers:
- url: https://scrive.com/api/v2
  description: Production
- url: https://api-testbed.scrive.com/api/v2
  description: API Testbed (development)
security:
- oauth2: []
- oauth1: []
tags:
- name: Documents
paths:
  /documents/new:
    post:
      tags:
      - Documents
      operationId: newDocument
      summary: Create a new document
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                saved:
                  type: boolean
      responses:
        '201':
          description: Created document.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Document'
  /documents/{document_id}/update:
    post:
      tags:
      - Documents
      operationId: updateDocument
      summary: Update a document
      parameters:
      - $ref: '#/components/parameters/DocumentId'
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                document:
                  type: string
                  description: JSON document definition.
      responses:
        '200':
          description: Updated document.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Document'
  /documents/{document_id}/setfile:
    post:
      tags:
      - Documents
      operationId: setFile
      summary: Set the main file of a document
      parameters:
      - $ref: '#/components/parameters/DocumentId'
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
      responses:
        '200':
          description: File set.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Document'
  /documents/{document_id}/appendfile:
    post:
      tags:
      - Documents
      operationId: appendFile
      summary: Append a PDF to a document
      parameters:
      - $ref: '#/components/parameters/DocumentId'
      responses:
        '200':
          description: File appended.
  /documents/{document_id}/start:
    post:
      tags:
      - Documents
      operationId: startDocument
      summary: Start the signing process
      parameters:
      - $ref: '#/components/parameters/DocumentId'
      responses:
        '200':
          description: Signing process started; document is pending.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Document'
  /documents/{document_id}/get:
    get:
      tags:
      - Documents
      operationId: getDocument
      summary: Retrieve a document
      parameters:
      - $ref: '#/components/parameters/DocumentId'
      responses:
        '200':
          description: Document.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Document'
  /documents/{short_document_id}/getbyshortid:
    get:
      tags:
      - Documents
      operationId: getByShortId
      summary: Retrieve a document by short ID
      parameters:
      - name: short_document_id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Document.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Document'
  /documents/list:
    get:
      tags:
      - Documents
      operationId: listDocuments
      summary: List documents
      parameters:
      - name: filter
        in: query
        schema:
          type: string
        description: JSON-encoded filter.
      - name: sorting
        in: query
        schema:
          type: string
      - name: offset
        in: query
        schema:
          type: integer
      - name: max
        in: query
        schema:
          type: integer
      responses:
        '200':
          description: A list of documents.
          content:
            application/json:
              schema:
                type: object
                properties:
                  total_matching:
                    type: integer
                  documents:
                    type: array
                    items:
                      $ref: '#/components/schemas/Document'
  /documents/{document_id}/canbestarted:
    get:
      tags:
      - Documents
      operationId: canBeStarted
      summary: Validate a document is ready to start
      parameters:
      - $ref: '#/components/parameters/DocumentId'
      responses:
        '200':
          description: Readiness result.
  /documents/{document_id}/prolong:
    post:
      tags:
      - Documents
      operationId: prolong
      summary: Extend document expiry
      parameters:
      - $ref: '#/components/parameters/DocumentId'
      responses:
        '200':
          description: Expiry extended.
  /documents/{document_id}/cancel:
    post:
      tags:
      - Documents
      operationId: cancel
      summary: Cancel a pending document
      parameters:
      - $ref: '#/components/parameters/DocumentId'
      responses:
        '200':
          description: Document canceled.
  /documents/{document_id}/trash:
    post:
      tags:
      - Documents
      operationId: trash
      summary: Move a document to trash
      parameters:
      - $ref: '#/components/parameters/DocumentId'
      responses:
        '200':
          description: Document trashed.
  /documents/{document_id}/delete:
    post:
      tags:
      - Documents
      operationId: deleteDocument
      summary: Delete a document
      parameters:
      - $ref: '#/components/parameters/DocumentId'
      responses:
        '200':
          description: Document deleted.
components:
  schemas:
    Signatory:
      type: object
      properties:
        id:
          type: string
        is_author:
          type: boolean
        is_signatory:
          type: boolean
        fields:
          type: array
          items:
            type: object
        authentication_method_to_view:
          type: string
        authentication_method_to_sign:
          type: string
    Document:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        status:
          type: string
          enum:
          - preparation
          - pending
          - closed
          - canceled
          - timedout
          - rejected
          - document_error
        parties:
          type: array
          items:
            $ref: '#/components/schemas/Signatory'
        file:
          type: object
          nullable: true
        api_callback_url:
          type: string
          nullable: true
        ctime:
          type: string
          format: date-time
        mtime:
          type: string
          format: date-time
  parameters:
    DocumentId:
      name: document_id
      in: path
      required: true
      schema:
        type: string
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://oauth2.scrive.com/oauth2/authorization
          tokenUrl: https://oauth2.scrive.com/oauth2/token
          scopes:
            doc:create: Create documents
            doc:check: Read documents
            doc:send: Send documents
            full: Full access
            offline_access: Refresh tokens
            openid: OpenID Connect
    oauth1:
      type: apiKey
      in: header
      name: Authorization
      description: OAuth 1.0 or personal access credentials passed in the Authorization header using PLAINTEXT signatures (oauth_consumer_key, oauth_token, oauth_signature).