---
title: "Create Git Spider"
method: POST
path: "/gits/{id}/spiders"
tags: ["Git"]
---

# Create Git Spider

`POST /gits/{id}/spiders`

Create a new spider of a git repository

## Path parameters

- `id` string, objectid, required — The ID of the git repository

## Request body

- CreateGitSpiderInput
  - `data` ModelsSpider, required — The spider data to create
    - `_id` string, objectid — ID
    - `cmd` string — Execute command
    - `col_id` string, objectid — Data collection id
    - `col_name` string — Data collection name
    - `created_at` string, date-time — Created timestamp
    - `created_by` string, objectid — Created by
    - `database_id` string, objectid — Database Id
    - `db_name` string — Database name
    - `description` string — Description
    - `git_id` string, objectid — Related Git ID
    - `git_root_path` string — Git root path
    - `mode` 'random' | 'all' | 'selected-nodes' — Default task mode
    - `name` string — Spider name
    - `node_group_ids` string[] — Default node group ids, used in selected-node-groups mode
    - `node_ids` string[] — Default node ids, used in selected-nodes mode
    - `param` string — Default task param
    - `priority` integer — Priority
    - `project_id` string, objectid — Project ID
    - `template` string — Spider template
    - `template_params` ModelsSpiderTemplateParams — Spider template params
      - `allowed_domains` string — Allowed domains
      - `project_name` string — Project name
      - `spider_name` string — Spider name
      - `start_urls` string — Start urls
    - `updated_at` string, date-time — Updated timestamp
    - `updated_by` string, objectid — Updated by

## Response `200`

OK

- ControllersResponseGithubModelsSpider
  - `data` ModelsSpider — The spider data to create
    - `_id` string, objectid — ID
    - `cmd` string — Execute command
    - `col_id` string, objectid — Data collection id
    - `col_name` string — Data collection name
    - `created_at` string, date-time — Created timestamp
    - `created_by` string, objectid — Created by
    - `database_id` string, objectid — Database Id
    - `db_name` string — Database name
    - `description` string — Description
    - `git_id` string, objectid — Related Git ID
    - `git_root_path` string — Git root path
    - `mode` 'random' | 'all' | 'selected-nodes' — Default task mode
    - `name` string — Spider name
    - `node_group_ids` string[] — Default node group ids, used in selected-node-groups mode
    - `node_ids` string[] — Default node ids, used in selected-nodes mode
    - `param` string — Default task param
    - `priority` integer — Priority
    - `project_id` string, objectid — Project ID
    - `template` string — Spider template
    - `template_params` ModelsSpiderTemplateParams — Spider template params
      - `allowed_domains` string — Allowed domains
      - `project_name` string — Project name
      - `spider_name` string — Spider name
      - `start_urls` string — Start urls
    - `updated_at` string, date-time — Updated timestamp
    - `updated_by` string, objectid — Updated by
  - `error` string
  - `message` string
  - `status` string

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `500` — Internal Server Error

## Changes

- **2026-07-17** `c7a4715c1f13` — 2 breaking, 2 warning, 9 info
  - added the new required request property `data`
  - for the `path` request parameter `id`, the type/format was changed from `string`/`` to `string`/`objectid`
  - removed the request property `path`
  - removed the optional property `code` from the response with the `200` status
  - …9 more
- **2025-03-03** `14e4eafea538` — 1 warning
  - removed the optional property `data` from the response with the `200` status
- **2025-03-02** `526e5bdf6dee` — 3 breaking, 25 warning, 6 info
  - added the new required request property `path`
  - request body became required
  - added the pattern `^[0-9a-fA-F]{24}$` to the `path` request parameter `id`
  - removed the request property `data`
  - …30 more

[Change history](https://skmtc.dev/crawlab-team/apis/crawlab-api/changes/gits/:id/spiders/post.md)

---

[API](https://skmtc.dev/crawlab-team/apis/crawlab-api.md) · [All operations](https://skmtc.dev/crawlab-team/apis/crawlab-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/crawlab-team/crawlab-api/revisions/c7a4715c1f13/schema)
