Add a dependency an issue is blocked by
POST
/repos/{owner}/{repo}/issues/{issue_number}/dependencies/blocked_by https://api.github.com
You can use the REST API to add a 'blocked by' relationship to an issue.
Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see Rate limits for the API and Best practices for using the REST API.
This endpoint supports the following custom media types. For more information, see Media types.
application/vnd.github.raw+json: Returns the raw Markdown body. Response will includebody. This is the default if you do not pass any specific media type.application/vnd.github.text+json: Returns a text only representation of the Markdown body. Response will includebody_text.application/vnd.github.html+json: Returns HTML rendered from the body's Markdown. Response will includebody_html.application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will includebody,body_text, andbody_html.
Parameters
path Path Parameters
| Name | Type |
|---|---|
owner
required
The account owner of the repository. The name is not case sensitive. | string |
repo
required
The name of the repository without the | string |
issue_number
required
The number that identifies the issue. | number |
Request Body
application/json
required
{ issue_id: number; }
Responses
201 application/json
Response
interface Issue {
id: number;
node_id: string;
url: string;
repository_url: string;
labels_url: string;
comments_url: string;
events_url: string;
html_url: string;
number: number;
state: string;
state_reason?: "completed" | "reopened" | "not_planned" | "duplicate" | null;
title: string;
body?: string | null;
user:SimpleUser | null;
labels: ({
id?: number;
node_id?: string;
url?: string;
name?: string;
description?: string | null;
color?: string | null;
default?: boolean;
} | string)[];
assignee:SimpleUser | null;
assignees?:SimpleUser [] | null;
milestone:Milestone | null;
locked: boolean;
active_lock_reason?: string | null;
comments: number;
pull_request?: {
merged_at?: string | null;
diff_url: string | null;
html_url: string | null;
patch_url: string | null;
url: string | null;
};
closed_at: string | null;
created_at: string;
updated_at: string;
draft?: boolean;
closed_by?:SimpleUser | null;
body_html?: string;
body_text?: string;
timeline_url?: string;
type?:IssueType ;
repository?:Repository ;
performed_via_github_app?:Integration | null;
author_association?:AuthorAssociation ;
reactions?:ReactionRollup ;
sub_issues_summary?:SubIssuesSummary ;
parent_issue_url?: string | null;
issue_dependencies_summary?:IssueDependenciesSummary ;
issue_field_values?:IssueFieldValue [];
}
id: number;
node_id: string;
url: string;
repository_url: string;
labels_url: string;
comments_url: string;
events_url: string;
html_url: string;
number: number;
state: string;
state_reason?: "completed" | "reopened" | "not_planned" | "duplicate" | null;
title: string;
body?: string | null;
user:
labels: ({
id?: number;
node_id?: string;
url?: string;
name?: string;
description?: string | null;
color?: string | null;
default?: boolean;
} | string)[];
assignee:
assignees?:
milestone:
locked: boolean;
active_lock_reason?: string | null;
comments: number;
pull_request?: {
merged_at?: string | null;
diff_url: string | null;
html_url: string | null;
patch_url: string | null;
url: string | null;
};
closed_at: string | null;
created_at: string;
updated_at: string;
draft?: boolean;
closed_by?:
body_html?: string;
body_text?: string;
timeline_url?: string;
type?:
repository?:
performed_via_github_app?:
author_association?:
reactions?:
sub_issues_summary?:
parent_issue_url?: string | null;
issue_dependencies_summary?:
issue_field_values?:
}
Redirects
301 application/json
Moved permanently
interface BasicError {
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
Client Errors
403 application/json
Forbidden
interface BasicError {
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
404 application/json
Resource not found
interface BasicError {
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
410 application/json
Gone
interface BasicError {
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
422 application/json
Validation failed, or the endpoint has been spammed.
interface ValidationError {
message: string;
documentation_url: string;
errors?: {
resource?: string;
field?: string;
message?: string;
code: string;
index?: number;
value?: string[] | string | number | null;
}[];
}
message: string;
documentation_url: string;
errors?: {
resource?: string;
field?: string;
message?: string;
code: string;
index?: number;
value?: string[] | string | number | null;
}[];
}