Zego Shifts API

Start and end insurance cover periods (shifts) for customers.

OpenAPI Specification

zego-shifts-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Zego Partner Customer Integration Shifts API
  version: '2.0'
  description: The Zego Partner API is a RESTful interface for partners and work providers to interact with Zego on behalf of Zego customers. It covers shift management (starting and ending insurance cover for gig-economy drivers and couriers), customer status and validation, customer registration and enrolment, fixed-term public liability policies, supported occupations, and customer matching. Access is granted to partners via an authorization token issued by the Zego Partnerships Manager. This specification was generated by the API Evangelist enrichment pipeline from Zego's published partner developer documentation at https://developer.zego.com/ — it is faithful to the documented operations but is not an official Zego artifact.
  contact:
    name: Zego Partnerships
    url: https://developer.zego.com/
  x-apievangelist-generated: true
  x-source: https://developer.zego.com/
servers:
- url: https://api.zego.com
  description: Production
security:
- partnerToken: []
tags:
- name: Shifts
  description: Start and end insurance cover periods (shifts) for customers.
paths:
  /v1/shift/login/:
    post:
      operationId: startShift
      tags:
      - Shifts
      summary: Start an individual customer's shift
      description: Starts a shift, activating insurance cover for a single customer.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Shift login payload identifying the customer.
      responses:
        '200':
          description: Shift started
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
  /v1/shift/logout/:
    post:
      operationId: endShift
      tags:
      - Shifts
      summary: End a customer's shift
      description: Ends a shift, deactivating insurance cover for a single customer.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Shift logout payload identifying the customer.
      responses:
        '200':
          description: Shift ended
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
  /v1/batch/login/:
    post:
      operationId: startBatchShifts
      tags:
      - Shifts
      summary: Start shifts for multiple customers
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Batch shift login payload for multiple customers.
      responses:
        '200':
          description: Batch shifts started
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
  /v1/batch/logout/:
    post:
      operationId: endBatchShifts
      tags:
      - Shifts
      summary: End shifts for multiple customers
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Batch shift logout payload for multiple customers.
      responses:
        '200':
          description: Batch shifts ended
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
  /v2/shift/:
    post:
      operationId: createShift
      tags:
      - Shifts
      summary: Create a shift (open or finished)
      description: Creates a shift that may be left open or created with an end time.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Shift creation payload.
      responses:
        '201':
          description: Shift created
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
  /v2/shift/{id}:
    put:
      operationId: updateShift
      tags:
      - Shifts
      summary: Update a shift with an end time
      parameters:
      - name: id
        in: path
        required: true
        description: Identifier of the shift to update.
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Shift update payload (end time).
      responses:
        '200':
          description: Shift updated
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '404':
          description: Shift not found
components:
  securitySchemes:
    partnerToken:
      type: apiKey
      in: header
      name: Authorization
      description: Partner authorization token issued by the Zego Partnerships Manager, sent in the Authorization header.