openapi: 3.2.0 info: title: Operations Hub Planning.campaigns API version: 0.1.1 description: '' servers: [] tags: - name: planning.campaigns paths: /api/planning/v1/campaigns: get: operationId: list_campaigns summary: List Campaigns parameters: - in: query name: search schema: anyOf: - type: string - type: 'null' title: Search required: false - in: query name: sort schema: anyOf: - type: string - type: 'null' title: Sort required: false - in: query name: status schema: anyOf: - type: string - type: 'null' title: Status required: false - in: query name: customer_id schema: anyOf: - type: integer - type: 'null' title: Customer Id required: false - in: query name: paginate schema: default: true description: Enable pagination (false returns all results) title: Paginate type: boolean required: false description: Enable pagination (false returns all results) - in: query name: page schema: default: 1 description: Page number minimum: 1 title: Page type: integer required: false description: Page number - in: query name: page_size schema: default: 50 description: Number of items per page maximum: 1000 minimum: 1 title: Page Size type: integer required: false description: Number of items per page responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/PlanningCampaignResponse' title: Response type: array '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/Error' description: List all items with optional search, sorting, and pagination. tags: - planning.campaigns security: - APIKeyAuth: [] - CookieAuth: [] post: operationId: create_campaign summary: Create Campaign parameters: [] responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/PlanningCampaignResponse' description: Create a new item. tags: - planning.campaigns requestBody: content: application/json: schema: $ref: '#/components/schemas/PlanningCampaignCreate' required: true security: - APIKeyAuth: [] - CookieAuth: [] /api/planning/v1/campaigns/{id}: get: operationId: get_campaign summary: Get Campaign parameters: - in: path name: id schema: title: Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/PlanningCampaignResponse' description: Get a single item by ID. tags: - planning.campaigns security: - APIKeyAuth: [] - CookieAuth: [] patch: operationId: update_campaign summary: Update Campaign parameters: - in: path name: id schema: title: Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/PlanningCampaignResponse' description: Update an item. tags: - planning.campaigns requestBody: content: application/json: schema: $ref: '#/components/schemas/PlanningCampaignUpdate' required: true security: - APIKeyAuth: [] - CookieAuth: [] delete: operationId: delete_campaign summary: Delete Campaign parameters: - in: path name: id schema: title: Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Success' description: Soft delete an item. tags: - planning.campaigns security: - APIKeyAuth: [] - CookieAuth: [] components: schemas: PlanningCampaignUpdate: properties: name: anyOf: - type: string - type: 'null' title: Name status: anyOf: - type: string - type: 'null' title: Status description: anyOf: - type: string - type: 'null' title: Description planned_start_date: anyOf: - format: date type: string - type: 'null' title: Planned Start Date planned_end_date: anyOf: - format: date type: string - type: 'null' title: Planned End Date actual_start_date: anyOf: - format: date type: string - type: 'null' title: Actual Start Date actual_end_date: anyOf: - format: date type: string - type: 'null' title: Actual End Date planned_cost: anyOf: - type: number - type: string - type: 'null' title: Planned Cost actual_cost: anyOf: - type: number - type: string - type: 'null' title: Actual Cost currency_id: anyOf: - type: integer - type: 'null' title: Currency Id notes: anyOf: - type: string - type: 'null' title: Notes title: PlanningCampaignUpdate type: object PlanningCampaignResponse: properties: id: title: Id type: integer name: title: Name type: string status: title: Status type: string customer_id: title: Customer Id type: integer customer: anyOf: - $ref: '#/components/schemas/PlanningNestedCustomer' - type: 'null' description: anyOf: - type: string - type: 'null' title: Description planned_start_date: anyOf: - format: date type: string - type: 'null' title: Planned Start Date planned_end_date: anyOf: - format: date type: string - type: 'null' title: Planned End Date actual_start_date: anyOf: - format: date type: string - type: 'null' title: Actual Start Date actual_end_date: anyOf: - format: date type: string - type: 'null' title: Actual End Date planned_cost: anyOf: - type: number - type: string - type: 'null' title: Planned Cost actual_cost: anyOf: - type: number - type: string - type: 'null' title: Actual Cost currency_id: anyOf: - type: integer - type: 'null' title: Currency Id currency: anyOf: - $ref: '#/components/schemas/PlanningNestedCurrency' - type: 'null' notes: anyOf: - type: string - type: 'null' title: Notes created_at: format: date-time title: Created At type: string updated_at: format: date-time title: Updated At type: string required: - id - name - status - customer_id - created_at - updated_at title: PlanningCampaignResponse type: object PlanningCampaignCreate: additionalProperties: false properties: customer_id: title: Customer Id type: integer name: title: Name type: string status: anyOf: - type: string - type: 'null' default: PLANNED title: Status description: anyOf: - type: string - type: 'null' title: Description planned_start_date: anyOf: - format: date type: string - type: 'null' title: Planned Start Date planned_end_date: anyOf: - format: date type: string - type: 'null' title: Planned End Date actual_start_date: anyOf: - format: date type: string - type: 'null' title: Actual Start Date actual_end_date: anyOf: - format: date type: string - type: 'null' title: Actual End Date planned_cost: anyOf: - type: number - type: string - type: 'null' title: Planned Cost actual_cost: anyOf: - type: number - type: string - type: 'null' title: Actual Cost currency_id: anyOf: - type: integer - type: 'null' title: Currency Id notes: anyOf: - type: string - type: 'null' title: Notes required: - customer_id - name title: PlanningCampaignCreate type: object PlanningNestedCurrency: properties: id: title: Id type: integer code: title: Code type: string name: title: Name type: string required: - id - code - name title: PlanningNestedCurrency type: object PlanningNestedCustomer: properties: id: title: Id type: integer display_name: title: Display Name type: string required: - id - display_name title: PlanningNestedCustomer type: object Error: additionalProperties: false description: Error response schema. properties: code: $ref: '#/components/schemas/ErrorCode' message: title: Message type: string required: - code - message title: Error type: object Success: additionalProperties: false description: 'Schema returned for successful operations. The `success` field is always ``true`` in this schema. Failed operations are represented by the :class:`Error` schema instead, so a ``false`` value does not occur in practice. The field is included for consistency across responses and to make the contract explicit for clients.' properties: success: default: true description: Always true for this schema. Errors are represented by a separate Error schema, so false is never returned. title: Success type: boolean title: Success type: object ErrorCode: description: Error codes for API errors. enum: - validation - server - auth - unknown - external - generic title: ErrorCode type: string securitySchemes: APIKeyAuth: type: http scheme: bearer CookieAuth: type: apiKey in: cookie name: opshub_prod_sessionid AuthBearer: type: http scheme: bearer