Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira API fails to authenticate

Jane Brusilovsky
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 22, 2025

I have been attempting to use Jira API to create jira cards. I kept receiving the following error: {"errorMessages":["You do not have permission to create issues in this project."],"errors":{}}. 

I attempted to figure out what was going on since I gave the API token all possible scopes and set max project permissions for creating issues. 

I used the following command to check if it is just an issue with the authentication:
curl -H "Content-Type: application/json" -u "[my email]:[my token]" --url "https://[my base url].atlassian.net/rest/api/3/myself"

and received: 
Client must be authenticated to access this resource.

What do I need to do get it to work?

1 answer

0 votes
Akash Singh
Community Champion
May 22, 2025

Hi @Jane Brusilovsky, Welcome to Atlassian Community!

To create a Work Item (previously referred to as an "Issue") in Jira Cloud using the REST API, you’ll need to interact with the Create Issue endpoint:

POST /rest/api/3/issue

📘 API Documentation – Create Issue

✅ Minimum Required Fields

For the issue creation to succeed, your request payload (in JSON) must include some essential fields:

  • Project Key or Project ID (project.key or project.id) – to specify the project where the issue will be created

  • Issue Type ID (issuetype.id) – to define the type of work item (e.g., Task, Bug, Story)

  • Summary (summary) – a brief description or title of the issue

  • Any other required custom fields that are marked mandatory in the Jira configuration for that project and issue type

If any required fields are missing or contain invalid data, the API will return an error and the issue will not be created.


🔍 How to Discover Required Fields Dynamically

Since required fields can vary between projects and issue types (due to field configurations, screens, and workflows), it's best to use the Create Meta API to determine what fields are required before attempting to create the issue.

Step 1: Get All Available Issue Types for a Project

Use the following endpoint to fetch all issue types available for a specific project:

GET /rest/api/3/issue/createmeta/{projectIdOrKey}/issuetypes

📘 API – Get Create Meta (Project Level)

This returns a list of issue types configured in the specified project.

Step 2: Get Field Metadata for a Specific Issue Type

Once you’ve identified the issue type you want to work with, you can fetch its metadata to see all the fields (including which ones are required and what options are available):

GET /rest/api/3/issue/createmeta/{projectIdOrKey}/issuetypes/{issueTypeId}

📘 API – Get Create Meta (Issue Type Level)

This will return details about:

  • All fields applicable for the issue type

  • Which fields are required

  • Allowed values (e.g., dropdown options, field types)

  • Field schemas (like string, array, number, etc.)

Akash Singh
Community Champion
May 22, 2025

@Jane Brusilovsky Just to add to my earlier response, API tokens with specific scopes are tied to OAuth 2.0 (3LO) and cannot be used directly with standard Jira REST API endpoints.

To use OAuth 2.0 tokens, you'll first need to construct the request using the appropriate resource URL that includes your Cloud ID, as outlined in the documentation:
🔗 Enabling OAuth 2.0 (3LO) for Atlassian Cloud

Your API endpoint should look like this:

https://api.atlassian.com/ex/jira/{cloudid}/rest/api/3/myself

You can also retrieve the cloudid following the steps mentioned in this Atlassian guide.

Below curl command should work for fetching your profile details,

curl --request GET \
--url 'https://api.atlassian.com/ex/jira/{cloudId}/rest/api/3/myself' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json'

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events