# articleUpdate - admin - MUTATION Version: unstable ## Description Updates an article. ### Access Scopes Any of `write_content`, `write_online_store_pages` access scopes. ## Arguments * [article](/docs/api/admin/unstable/input-objects/ArticleUpdateInput): ArticleUpdateInput! - The properties of the article to be updated. * [blog](/docs/api/admin/unstable/input-objects/ArticleBlogInput): ArticleBlogInput - The properties of the blog to be created. * [id](/docs/api/admin/unstable/scalars/ID): ID! - The ID of the article to be updated. ## Returns * [article](/docs/api/admin/unstable/objects/Article): Article The article that was updated. * [userErrors](/docs/api/admin/unstable/objects/ArticleUpdateUserError): ArticleUpdateUserError! The list of errors that occurred from executing the mutation. ## Examples ### Update an article with new data Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation UpdateArticle($id: ID!, $article: ArticleUpdateInput!) { articleUpdate(id: $id, article: $article) { article { id title handle body summary tags image { altText originalSrc } } userErrors { field message } } }\",\n \"variables\": {\n \"id\": \"gid://shopify/Article/959752435\",\n \"article\": {\n \"title\": \"Updated Article Title\",\n \"handle\": \"updated-article-title\",\n \"body\": \"This is the updated content of the article.\",\n \"summary\": \"This is an updated summary of the article.\",\n \"isPublished\": true,\n \"publishDate\": \"2023-01-01T12:00:00Z\",\n \"tags\": [\n \"UpdatedTag1\",\n \"UpdatedTag2\"\n ],\n \"image\": {\n \"altText\": \"Updated alt text for the image\",\n \"url\": \"http://example.com/fake_image.jpg\"\n }\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation UpdateArticle($id: ID!, $article: ArticleUpdateInput!) {\n articleUpdate(id: $id, article: $article) {\n article {\n id\n title\n handle\n body\n summary\n tags\n image {\n altText\n originalSrc\n }\n }\n userErrors {\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"id\": \"gid://shopify/Article/959752435\",\n \"article\": {\n \"title\": \"Updated Article Title\",\n \"handle\": \"updated-article-title\",\n \"body\": \"This is the updated content of the article.\",\n \"summary\": \"This is an updated summary of the article.\",\n \"isPublished\": true,\n \"publishDate\": \"2023-01-01T12:00:00Z\",\n \"tags\": [\n \"UpdatedTag1\",\n \"UpdatedTag2\"\n ],\n \"image\": {\n \"altText\": \"Updated alt text for the image\",\n \"url\": \"http://example.com/fake_image.jpg\"\n }\n }\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation UpdateArticle($id: ID!, $article: ArticleUpdateInput!) {\n articleUpdate(id: $id, article: $article) {\n article {\n id\n title\n handle\n body\n summary\n tags\n image {\n altText\n originalSrc\n }\n }\n userErrors {\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"id\": \"gid://shopify/Article/959752435\",\n \"article\": {\n \"title\": \"Updated Article Title\",\n \"handle\": \"updated-article-title\",\n \"body\": \"This is the updated content of the article.\",\n \"summary\": \"This is an updated summary of the article.\",\n \"isPublished\": true,\n \"publishDate\": \"2023-01-01T12:00:00Z\",\n \"tags\": [\"UpdatedTag1\", \"UpdatedTag2\"],\n \"image\": {\n \"altText\": \"Updated alt text for the image\",\n \"url\": \"http://example.com/fake_image.jpg\"\n }\n }\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation UpdateArticle($id: ID!, $article: ArticleUpdateInput!) {\n articleUpdate(id: $id, article: $article) {\n article {\n id\n title\n handle\n body\n summary\n tags\n image {\n altText\n originalSrc\n }\n }\n userErrors {\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"id\": \"gid://shopify/Article/959752435\",\n \"article\": {\n \"title\": \"Updated Article Title\",\n \"handle\": \"updated-article-title\",\n \"body\": \"This is the updated content of the article.\",\n \"summary\": \"This is an updated summary of the article.\",\n \"isPublished\": true,\n \"publishDate\": \"2023-01-01T12:00:00Z\",\n \"tags\": [\n \"UpdatedTag1\",\n \"UpdatedTag2\"\n ],\n \"image\": {\n \"altText\": \"Updated alt text for the image\",\n \"url\": \"http://example.com/fake_image.jpg\"\n }\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation UpdateArticle($id: ID!, $article: ArticleUpdateInput!) {\n articleUpdate(id: $id, article: $article) {\n article {\n id\n title\n handle\n body\n summary\n tags\n image {\n altText\n originalSrc\n }\n }\n userErrors {\n field\n message\n }\n }\n}" #### Graphql Input { "id": "gid://shopify/Article/959752435", "article": { "title": "Updated Article Title", "handle": "updated-article-title", "body": "This is the updated content of the article.", "summary": "This is an updated summary of the article.", "isPublished": true, "publishDate": "2023-01-01T12:00:00Z", "tags": [ "UpdatedTag1", "UpdatedTag2" ], "image": { "altText": "Updated alt text for the image", "url": "http://example.com/fake_image.jpg" } } } #### Graphql Response { "data": { "articleUpdate": { "article": { "id": "gid://shopify/Article/959752435", "title": "Updated Article Title", "handle": "updated-article-title", "body": "This is the updated content of the article.", "summary": "This is an updated summary of the article.", "tags": [ "UpdatedTag1", "UpdatedTag2" ], "image": { "altText": "Updated alt text for the image", "originalSrc": "https://cdn.shopify.com/s/files/1/2637/1970/articles/fake_image.jpg?v=1730243703" } }, "userErrors": [] } } } ### Updates an article Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation UpdateArticle($id: ID!, $article: ArticleUpdateInput!) { articleUpdate(id: $id, article: $article) { article { id title handle body summary tags image { altText originalSrc } } userErrors { code field message } } }\",\n \"variables\": {\n \"id\": \"gid://shopify/Article/959752435\",\n \"article\": {\n \"title\": \"Updated Article Title\",\n \"handle\": \"updated-article-title\",\n \"body\": \"This is the updated content of the article.\",\n \"summary\": \"This is an updated summary of the article.\",\n \"tags\": [\n \"UpdatedTag1\",\n \"UpdatedTag2\"\n ],\n \"image\": {\n \"altText\": \"Updated alt text for the image\",\n \"url\": \"http://example.com/fake_image.jpg\"\n }\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation UpdateArticle($id: ID!, $article: ArticleUpdateInput!) {\n articleUpdate(id: $id, article: $article) {\n article {\n id\n title\n handle\n body\n summary\n tags\n image {\n altText\n originalSrc\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"id\": \"gid://shopify/Article/959752435\",\n \"article\": {\n \"title\": \"Updated Article Title\",\n \"handle\": \"updated-article-title\",\n \"body\": \"This is the updated content of the article.\",\n \"summary\": \"This is an updated summary of the article.\",\n \"tags\": [\n \"UpdatedTag1\",\n \"UpdatedTag2\"\n ],\n \"image\": {\n \"altText\": \"Updated alt text for the image\",\n \"url\": \"http://example.com/fake_image.jpg\"\n }\n }\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation UpdateArticle($id: ID!, $article: ArticleUpdateInput!) {\n articleUpdate(id: $id, article: $article) {\n article {\n id\n title\n handle\n body\n summary\n tags\n image {\n altText\n originalSrc\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"id\": \"gid://shopify/Article/959752435\",\n \"article\": {\n \"title\": \"Updated Article Title\",\n \"handle\": \"updated-article-title\",\n \"body\": \"This is the updated content of the article.\",\n \"summary\": \"This is an updated summary of the article.\",\n \"tags\": [\"UpdatedTag1\", \"UpdatedTag2\"],\n \"image\": {\n \"altText\": \"Updated alt text for the image\",\n \"url\": \"http://example.com/fake_image.jpg\"\n }\n }\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation UpdateArticle($id: ID!, $article: ArticleUpdateInput!) {\n articleUpdate(id: $id, article: $article) {\n article {\n id\n title\n handle\n body\n summary\n tags\n image {\n altText\n originalSrc\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"id\": \"gid://shopify/Article/959752435\",\n \"article\": {\n \"title\": \"Updated Article Title\",\n \"handle\": \"updated-article-title\",\n \"body\": \"This is the updated content of the article.\",\n \"summary\": \"This is an updated summary of the article.\",\n \"tags\": [\n \"UpdatedTag1\",\n \"UpdatedTag2\"\n ],\n \"image\": {\n \"altText\": \"Updated alt text for the image\",\n \"url\": \"http://example.com/fake_image.jpg\"\n }\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation UpdateArticle($id: ID!, $article: ArticleUpdateInput!) {\n articleUpdate(id: $id, article: $article) {\n article {\n id\n title\n handle\n body\n summary\n tags\n image {\n altText\n originalSrc\n }\n }\n userErrors {\n code\n field\n message\n }\n }\n}" #### Graphql Input { "id": "gid://shopify/Article/959752435", "article": { "title": "Updated Article Title", "handle": "updated-article-title", "body": "This is the updated content of the article.", "summary": "This is an updated summary of the article.", "tags": [ "UpdatedTag1", "UpdatedTag2" ], "image": { "altText": "Updated alt text for the image", "url": "http://example.com/fake_image.jpg" } } } #### Graphql Response { "data": { "articleUpdate": { "article": { "id": "gid://shopify/Article/959752435", "title": "Updated Article Title", "handle": "updated-article-title", "body": "This is the updated content of the article.", "summary": "This is an updated summary of the article.", "tags": [ "UpdatedTag1", "UpdatedTag2" ], "image": { "altText": "Updated alt text for the image", "originalSrc": "https://cdn.shopify.com/s/files/1/2637/1970/articles/fake_image.jpg?v=1730243702" } }, "userErrors": [] } } }