> ## Documentation Index
> Fetch the complete documentation index at: https://support.i.moneyforward.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a contract for a service



## OpenAPI

````yaml https://api.itmc.i.moneyforward.com/public-api/docs/v1-json post /api/v1/organizations/{organizationId}/services/{serviceId}/services/{serviceId}/contracts
openapi: 3.0.0
info:
  title: Admina Public API
  description: >-
    Admina API is a RESTfull API providing programmatic access to much of the
    data in the system. It provides predictable URLs for accessing resources,
    and uses built-in HTTP features to receive commands and return responses.
    This makes it easy to communicate with from a wide variety of environments,
    from command-line utilities to gadgets to the browser URL bar itself.
  version: '1.0'
  contact: {}
servers:
  - url: https://api.itmc.i.moneyforward.com
security: []
tags:
  - name: Organizations
    description: ''
  - name: Users
    description: ''
  - name: Directory
    description: ''
  - name: Departments
    description: ''
  - name: Locations
    description: ''
  - name: Companies
    description: ''
  - name: People
    description: ''
  - name: Workspaces
    description: ''
  - name: Custom Service and Workspace
    description: ''
  - name: Workspace Accounts
    description: ''
  - name: Accounts
    description: ''
  - name: Contracts
    description: ''
  - name: Devices
    description: ''
  - name: Devices (alpha)
    description: ''
  - name: Alerts
    description: ''
  - name: Spends
    description: ''
  - name: Usage Optimization
    description: ''
  - name: Services
    description: ''
  - name: Requests
    description: ''
  - name: AuditLogs
    description: ''
  - name: EventLogs
    description: ''
paths:
  /api/v1/organizations/{organizationId}/services/{serviceId}/services/{serviceId}/contracts:
    post:
      tags:
        - Contracts
      summary: Create a contract for a service
      operationId: publicCreateContract
      parameters:
        - name: organizationId
          required: true
          in: path
          schema:
            type: number
        - name: serviceId
          required: true
          in: path
          schema:
            type: number
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicCreateContractRequestDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicContractResponseDto'
      security:
        - API-Key: []
components:
  schemas:
    PublicCreateContractRequestDto:
      type: object
      properties:
        name:
          type: string
          example: Monthly Contract
        workspaceId:
          type: number
          example: 12345678
          nullable: true
        dueDate:
          type: string
          example: '2023-01-01T00:00:00.000Z'
        repeatUnit:
          example: months
          allOf:
            - $ref: '#/components/schemas/ContractRepeatUnit'
        repeatValue:
          type: number
          example: 1
        peopleIds:
          example:
            - 1
            - 2
            - 3
          type: array
          items:
            type: string
        note:
          type: string
          example: Contract notes
      required:
        - name
        - dueDate
        - repeatUnit
        - repeatValue
    PublicContractResponseDto:
      type: object
      properties:
        id:
          type: number
          readOnly: true
          example: 1
        name:
          type: string
          readOnly: true
          example: Monthly Contract
        serviceId:
          type: number
          readOnly: true
          example: 123
        serviceName:
          type: string
          readOnly: true
          example: GitHub
        workspaceId:
          type: number
          nullable: true
          readOnly: true
          example: 456
        workspaceName:
          type: string
          nullable: true
          readOnly: true
          example: Production Workspace
        dueDate:
          format: date-time
          type: string
          readOnly: true
          example: '2023-01-01T00:00:00.000Z'
        nextDueDate:
          format: date-time
          type: string
          nullable: true
          readOnly: true
          example: '2023-02-01T00:00:00.000Z'
        note:
          type: string
          nullable: true
          readOnly: true
          example: Contract notes
      required:
        - id
        - name
        - serviceId
        - serviceName
        - workspaceId
        - workspaceName
        - dueDate
        - nextDueDate
        - note
    ContractRepeatUnit:
      type: string
      enum:
        - months
        - years
  securitySchemes:
    API-Key:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: >-
        For authenticated requests, set the `Authorization: Bearer your_api_key`
        parameter in the header. <br/>You can create and manage your API Keys by
        visiting the **API Keys** tab in the **Settings** page of your
        organization in <a target='_blank'
        href='https://itmc.i.moneyforward.com/'>Admina</a>

````