> ## Documentation Index
> Fetch the complete documentation index at: https://docs.diversion.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Mark P4 import as running

> Mark the Perforce import job as currently running by generating a new running_job_id and setting the start timestamp. This should be called when a continuous import job begins.



## OpenAPI

````yaml post /repos/{repo_id}/p4-import-state/mark-running
openapi: 3.0.3
info:
  title: Diversion Core API
  description: >-
    Definition of the Core API used to access low-level functionality of
    Diversion
  version: 0.2.0
servers:
  - url: https://api.diversion.dev/v0
    description: Base endpoint
security: []
paths:
  /repos/{repo_id}/p4-import-state/mark-running:
    parameters:
      - $ref: '#/components/parameters/RepoParam'
    post:
      tags:
        - Perforce Repository Import
      summary: Mark P4 import as running
      description: >-
        Mark the Perforce import job as currently running by generating a new
        running_job_id and setting the start timestamp. This should be called
        when a continuous import job begins.
      operationId: src.handlersv2.p4_import.mark_job_running
      parameters:
        - name: branch_ref
          in: query
          description: Ref ID of the branch to import to
          schema:
            type: string
            example: dv.branch.1
            minLength: 1
            maxLength: 128
        - name: p4_import_path
          in: query
          description: Path in Perforce depot to import from
          schema:
            type: string
            example: //depot/main/...
            minLength: 1
            maxLength: 1024
      responses:
        '200':
          description: Job marked as running successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  running_job_id:
                    type: string
                    description: The generated UUID for this running job instance
                required:
                  - running_job_id
        '400':
          $ref: '#/components/responses/BadRequest'
          description: Bad request - invalid `job_id`
        '404':
          $ref: '#/components/responses/NotFound'
          description: Repository not found or no import job configured
        default:
          $ref: '#/components/responses/Error'
      security:
        - OAuth2:
            - coreapi/write
components:
  parameters:
    RepoParam:
      in: path
      name: repo_id
      required: true
      schema:
        type: string
        example: example_id
        minLength: 3
        maxLength: 128
      description: >-
        The repo ID of the repository. Repo _name_ can be used instead of the
        ID, but usage of ID for permanent linking and API requests is preferred.
  responses:
    BadRequest:
      description: The request does not meet the required conditions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The specified resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Error:
      description: An error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code
        detail:
          type: string
        title:
          type: string
        type:
          type: string
      required:
        - status
        - detail
  securitySchemes:
    OAuth2:
      type: oauth2
      x-tokenInfoFunc: src.token_info.token_auth
      description: This API uses OAuth 2 with the implicit grant flow
      flows:
        implicit:
          authorizationUrl: https://auth.diversion.dev/oauth2/authorize
          scopes:
            coreapi/read: Operations with no possible side-effects
            coreapi/write: Modifying operations
            coreapi/admin: >-
              Organizational operations like adding a repo or changing repo
              properties

````